This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Installing a feature based on Property value
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
‎May 15, 2008
04:48 PM
Installing a feature based on Property value
I am having trouble conditionally installing a feature based on the value of a property. I am using a Basic MSI project.
I have a feature: "myFeature".
"myFeature" has an Install Level of 200 (The project uses 100). And has 1 condition. That condition is if INSTALL_FEATURE="TRUE" then the level is set to 1.
However when I run the installer and INSTALL_FEATURE is "TRUE", "myFeature" is not installed.
Note that INSTALL_FEATURE is has a property value defaulting to "***DO NOT BUILD***". It is set by the user via the command line or a Checkbox in the Installer UI.
What am I doing wrong?
I have a feature: "myFeature".
"myFeature" has an Install Level of 200 (The project uses 100). And has 1 condition. That condition is if INSTALL_FEATURE="TRUE" then the level is set to 1.
However when I run the installer and INSTALL_FEATURE is "TRUE", "myFeature" is not installed.
Note that INSTALL_FEATURE is has a property value defaulting to "***DO NOT BUILD***". It is set by the user via the command line or a Checkbox in the Installer UI.
What am I doing wrong?
(2) Replies
‎May 15, 2008
05:43 PM
I believe you'd have to change your installlevel to 200 to get the feature installed, in addition to the property change. However if that doesn't work I opted to do this via InstallScript at runtime. My install asks the user for a database connection and depending on the state of the database, I enable and disable two mutually exclusive features (A database "Install" and "Conversion").
Example installscript that sets "FeatureA" to install, and "FeatureB" to not install:
MsiSetFeatureState(hMSI, "FeatureA", INSTALLSTATE_LOCAL);
MsiSetFeatureState(hMSI, "FeatureB", INSTALLSTATE_ABSENT);
Example installscript that sets "FeatureA" to install, and "FeatureB" to not install:
MsiSetFeatureState(hMSI, "FeatureA", INSTALLSTATE_LOCAL);
MsiSetFeatureState(hMSI, "FeatureB", INSTALLSTATE_ABSENT);
‎May 16, 2008
09:29 AM
The MsiSetFeatureState worked, thanks.
However I am still wondering why using the condition directly in the Feature Condition editor fails to work.
However I am still wondering why using the condition directly in the Feature Condition editor fails to work.