cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JoderCoder
Level 8

Conditional installation of Features

I have a plug-in application for a few applications like IE, Firefox. IE files are different than Firefox. I have implemented this as features for each application and user can choose to install what application(s) to install the plug in for (Custom install).

What I would like to do is that if Firefox is not installed on the machine then the user shouldnt be able to choose to install Firefox plug-in. How can I achieve this?

I dont think I can use "Condition" which alters the install level of the feature, can I?

Thanks in advance.
Labels (1)
0 Kudos
(5) Replies
RobertDickau
Flexera Alumni

Actually, one option is to conditionally set the feature's install level to 0, which hides the feature in addition to not installing it.
0 Kudos
JoderCoder
Level 8

Thanks, that did the job for me.
0 Kudos
schmoli
Level 6

RobertDickau wrote:
Actually, one option is to conditionally set the feature's install level to 0, which hides the feature in addition to not installing it.


Is there any specific thing you need to do to cause these conditions to be re-evaluated?

Example: 2009 Basic MSI project.

I have a condition on "Feature1":
Level: 0
Condition: TEST_HIDE

If I set TEST_HIDE to a value in a custom action before the CustomSetup dialog (I've tried in both the InstallWelcome and the SQLLogin dialog), my MSI log shows that the value was set, but when Custom Setup is rendered -- the feature is there and visible in it's default state.

However, if I pass TEST_HIDE=1 in a command line argument so that it's set at the very beginning of the installation -- it successfully disables and hides the feature.

My ultimate goal is to set the state of 2 different features from information determined at pre-install time (SQL Login)... The features basically determine if I'm going to perform a new installation of an application database, or a conversion of an existing one.

EDIT: I have done some testing and verified that if the property is set before CostFinalize (UI) -- the feature will disappear, if it's after CostFinalize -- the condition is ignored. I really want to be able to completely hide features based on information gathered in the SQLLogin dialog. In my previous installs I have used the method MsiSetFeatureState to disable the feature, but that has always allowed a user to re-enable it manually and I like the idea of completely hiding it.
0 Kudos
H_2_O_s
Level 2

Hi - Any update on re-evaulating feature conditions during the UI as it is exactly what I need to do as well...
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

The Windows Installer CostFinalize action is responsible for evaluating feature and component conditions. Since the user interface runs after this action has run, any changes to feature conditions will not be reevaluated. Typically, our recommendation is to use a custom action (with MsiSetFeatureState) or AddLocal/Remove control events to update the feature states as needed. Unfortunately this does not allow for hiding features.
0 Kudos