Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 2

Hiding a feature in Install Shield 2010 using Install script


I am using Basic MSI Project. I have created 3 features under Organization/Features view. Based on user input in a custom dialog, I have a business logic to decide which features have to be installed by the installer.

In the customsetup dialog, I want to sccrodingly display only few features and hide the rest.

Also only the displayed components should be installed by the installer.

Can anyone tell me how to do this?

I tried the below 2 options,

Option 1:
1. In the View List under Organization, click Setup Design or Features.
2. Select the feature that you want to configure.
3. Click the Condition setting and then click the ellipsis button (...). The Feature Condition
Builder dialog box opens.
4. Click the New Condition button. InstallShield adds a new condition row to the Conditions box.
5. In the Level column, type 0.
6. In the Condition column, type the condition.
7. Click OK.

Option 2:

// Hide Feature1 from the end user.
FeatureSetData (MEDIA, "Feature1", FEATURE_FIELD_VISIBLE, FALSE, "");

I am not sure what MEDIA means here, i set it to the value of the Destination property of the feature, but I cant get this function call to work..

Can anyone suggest?
Labels (1)
0 Kudos
(1) Reply
Flexera Alumni

Yes, this is fairly tricky in Basic MSI. Feature conditions are evaluated when CostFinalize runs, and dialog boxes are generally displayed after that, which is why your first approach doesn't work.

To deselect a feature based on UI choices, you can use Remove control events (just as AddLocal and related control events will select features), but these won't hide the features.

If you do need to hide the features too, please search these forums for "hide feature runtime", and you'll see code in different languages for dynamically modifying the in-memory MSI database to hide features. (Our advanced MSI course talks about this technique at some length, since it seems to pop up a lot.)

You'll also want to verify that maintenance mode, silent installations, etc., work as desired, but first things first.
0 Kudos