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
- :
- Re: Hiding a feature in Install Shield 2010 using Install script
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
Jul 14, 2010
08:11 AM
Hiding a feature in Install Shield 2010 using Install script
Hi,
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?
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?
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jul 15, 2010
10:26 AM
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.
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.
