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
- :
- Feature Conditions
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 05, 2007
11:31 AM
Feature Conditions
I have 3 features in my project, and through a couple custom dialogs, I prompt the user for some info to determine which of the 3 feature(s) I want to install. I store the results of the dialog in some variables, like INS_FEAT_ONE, INS_FEAT_TWO, INS_FEAT_THREE. I set them to 1 or 0 depending on what happens on those custom dialogs.
I set conditions on my features to raise the INSTALLLEVEL of the feature for the condition, so for feature 1 I would have
Level 110 if INS_FEAT_ONE <> 1
And the same for feature 2 and feature 3.
However, when I run the install, none of the features get installed, and I am not having any luck figuring out why. I thought originally it would be that the feature conditions are evaluated in the execute sequence, so I made sure I put my INS_FEAT_* variables into the SecureCustomProperties property to ensure the values transfer between sequences, but still no go. Other features that do not rely on the conditions get installed, but not the conditional ones.
Any help would be appreciated,
Mike
I set conditions on my features to raise the INSTALLLEVEL of the feature for the condition, so for feature 1 I would have
Level 110 if INS_FEAT_ONE <> 1
And the same for feature 2 and feature 3.
However, when I run the install, none of the features get installed, and I am not having any luck figuring out why. I thought originally it would be that the feature conditions are evaluated in the execute sequence, so I made sure I put my INS_FEAT_* variables into the SecureCustomProperties property to ensure the values transfer between sequences, but still no go. Other features that do not rely on the conditions get installed, but not the conditional ones.
Any help would be appreciated,
Mike
(7) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 06, 2007
09:52 AM
What is the base install level for those features, and what is the INSTALLLEVEL of the product? I suspect you may have the level change backwards, as feature install levels higher than INSTALLLEVEL are generally not installed.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 06, 2007
10:55 AM
Feature conditions are evaluated by the standard Windows Installer CostFinalize action. This action runs prior to any dialogs being displayed and initializes things like feature and component states while evaluating conditions. After CostFinalize has run, feature conditions are never reevaluated. As such, by the time any dialogs are displayed, changing property values that are used by the feature conditions will have no effect on what features are selected for installation.
There are a few things you can try to work around this behavior:
- Use the information in the following KB to progressively include additional features to be installed:
HOWTO: Implementing Setup Types in a Basic MSI project
- Use AddLocal/Remove control events conditioned on your properties to include or exclude features to be installed.
- Use a custom action and the MsiSetFeatureState API to programmatically request the state of a feature.
There are a few things you can try to work around this behavior:
- Use the information in the following KB to progressively include additional features to be installed:
HOWTO: Implementing Setup Types in a Basic MSI project
- Use AddLocal/Remove control events conditioned on your properties to include or exclude features to be installed.
- Use a custom action and the MsiSetFeatureState API to programmatically request the state of a feature.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 06, 2007
03:36 PM
Thanks for the replies.
I noticed in the KB article that it talks about moving the CostFinalize action below the InstallWelcome panel. What would be the harm in moving CostFinalize to just before the SetupResume panel? That would do it if at that point the Features are selected, right?
I noticed in the KB article that it talks about moving the CostFinalize action below the InstallWelcome panel. What would be the harm in moving CostFinalize to just before the SetupResume panel? That would do it if at that point the Features are selected, right?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 06, 2007
03:48 PM
Using Method 2 from the article will break the SelectionTree control (which is used on the CustomSetup dialog). Also, moving CostFinalize seems to break the costing process on MSI 4.0 (Vista), which, if I remember correctly, results in runtime errors.
Method 1 was added to the article after it was created and is now the preferred method of implementing setup types. The second method was kept for reference purposes.
Method 1 was added to the article after it was created and is now the preferred method of implementing setup types. The second method was kept for reference purposes.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 06, 2007
04:27 PM
Yeah, I tried moving the Costing action down and it didn't create the expected results. (Nothing got installed)
I'm not sure I can use Method 1, given the three features are not "stacked" (for lack of a better word) on one another. I have three features, A, B, and C. They can be installed in the following configs:
A
A + C
B
B + C
C
Any suggestions?
I'm not sure I can use Method 1, given the three features are not "stacked" (for lack of a better word) on one another. I have three features, A, B, and C. They can be installed in the following configs:
A
A + C
B
B + C
C
Any suggestions?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 06, 2007
04:32 PM
And to answer your question, MichaelU, I have the InstallLevel of the project set at 100, and the initial install levels of the features set to 1. In the Condition property of the Features I was checking to see if the property I'm using to determine what to install is set, and if not, raising the InstallLevel of the Feature to 110 so it wouldn't get installed.
Also, I tried using the "Remove" event to not install the items I didn't want installed, and that works *great* for installing only the selected features, however, the uninstall then stops removing the files. I have a fourth Feature, that always gets installed, and those will be the only files removed during the uninstall process.
Also, I tried using the "Remove" event to not install the items I didn't want installed, and that works *great* for installing only the selected features, however, the uninstall then stops removing the files. I have a fourth Feature, that always gets installed, and those will be the only files removed during the uninstall process.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 10, 2007
09:26 AM
The AddLocal/Remove control events would be the simplest for your scenario. We've had other customer's use these without any adverse side effects during install or uninstall. Can you provide a little more detail on how you set up the Remove events and possibly post logs of the install/uninstall?