cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
heiner_violet
Level 7

feature condition: how does it work?

(Installshield 2008, Basic MSI)

Does the "Condition" entry of a feature work as expected?

I want to install a feature if and only if a property INSTALL_FEATURE is set.
Now, I gave the feature the "Install Level" 200 which is higher then the level of the package and added the following condition:
Level 1, Condition INSTALL_FEATURE.
Unfortunately, I noticed that this condition is ignored, whatever the value of property INSTALL_FEATURE is.

I solved the issue by calling MsiSetFeatureState from an Installscript-CA instead - but I would be glad to know how the "Condition" entry of a feature works.

Thanks in advance, H.
Labels (1)
0 Kudos
(4) Replies
RobertDickau
Flexera Alumni

How are you setting INSTALL_FEATURE? One thing to keep in mind is that MSI evaluates feature and component conditions when CostFinalize runs, so if you're changing INSTALL_FEATURE after that, it may be too late...
0 Kudos
repins
Level 3

I'm struggling with the same issue. My INSTALL_FEATURE condition is being ignored it seems. I have gone as far as to set a condition as 1=2 (which I would expect should always evaluate to false) with my feature Install Level set at 200 and the installer INSTALLLEVEL set to 100, yet my feature still gets installed every time. Presumably there's no dependency on something occurring before or after CostFinalize (given the 1=2 condition) so I'm not sure why the condition is ignored (or seemingly ignored). Even more confusing is that with the feature's Install Level set to 200 with NO condition set, the feature is still installed (granted it was the only feature and was selected for the Setup Type, but I wouldn't expect it to install based on my understanding of INSTALLLEVEL).

Am I missing something??? How does one set a feature to be selected, and then conditionally install it or not behind the scenes? Note that the feature is not showing in the custom feature selection dialog so it seems the Install Level setting on the feature is working, but why would it still install the feature anyway? The feature is not listed as required. So frustrated with this...
0 Kudos
TheResearch
Level 6

Try setting the install level for the feature set to 0(zero). This will make sure that the feature is not installed.
0 Kudos
repins
Level 3

Setting the INSTALLLEVEL to 0 does keep it from being installed, however, when I tried to uninstall the application, it gives a message similar to "...only for features installed" (I didn't write it down and don't feel like recreating it again ;)) and then aborts. Anyway, manually removed it from the system using regedit, but guessing then that using 0 as the default level isn't an option. Thanks for the suggestion. I may need to resort to call "MsiSetFeatureState" from a CA like "heiner_violet" did.
0 Kudos