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: Check if a feature is selected
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
‎Jan 22, 2012
05:20 AM
Check if a feature is selected
How can I check if a specific feature is selected by the user in custom setup? I want to execute a custom action during installation if a particular feature is selected . Thanks.
(5) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 23, 2012
02:54 AM
test on
if (FeatureIsItemSelected ( MEDIA, "MainFeature\\subFeature" )) then
or use
FeatureGetData (MEDIA, "Feature2", feature_FIELD_SELECTED, nvResult, svResult)
N.B. see the FeatureGetData sample.
if (FeatureIsItemSelected ( MEDIA, "MainFeature\\subFeature" )) then
or use
FeatureGetData (MEDIA, "Feature2", feature_FIELD_SELECTED, nvResult, svResult)
N.B. see the FeatureGetData sample.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 27, 2012
05:19 PM
(note: i'm still a complete noob)
i have 3 features, each of which have no sub-features
displayed in the tree as F1, F2, F3 ~ displayed in the IS dialog as Feature1, etc
i have tried both methods you suggest, using both "F1" and "Feature1"
result is consistently "not selected" regardless of actual selected status
can't figure out what i'm doing wrong 😞
any suggestions?
i have 3 features, each of which have no sub-features
displayed in the tree as F1, F2, F3 ~ displayed in the IS dialog as Feature1, etc
i have tried both methods you suggest, using both "F1" and "Feature1"
result is consistently "not selected" regardless of actual selected status
can't figure out what i'm doing wrong 😞
any suggestions?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 27, 2012
06:41 PM
i have this running as Immediate / After Filecost - why? i have no idea
should this check be done at some other point?
thanks
should this check be done at some other point?
thanks
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 28, 2012
02:03 PM
The Feature* InstallScript functions only work with InstallScript and InstallScript MSI projects. If you are calling these functions from an InstallScript custom action in Basic MSI projects (or an InstallScript custom action in InstallScript MSI projects) the functions will not provide an indication of the state of an MSI feature.
The simplest solution to running or not running a custom action based on the selection of a feature would be to use a condition on the custom action. The action state of a feature can be used in a condition such as the following:
&FeatureName=3
More information on conditional statements can be found in:
Conditional Statement Syntax
Examples of Conditional Statement Syntax
Note that this assumes the custom action is sequenced after feature selection occurs. If this action will modify any system state, it should be sequenced in the execute sequence as a deferred action (deferred in system context if it needs admin privileges when the MSI is run elevated).
The simplest solution to running or not running a custom action based on the selection of a feature would be to use a condition on the custom action. The action state of a feature can be used in a condition such as the following:
&FeatureName=3
More information on conditional statements can be found in:
Conditional Statement Syntax
Examples of Conditional Statement Syntax
Note that this assumes the custom action is sequenced after feature selection occurs. If this action will modify any system state, it should be sequenced in the execute sequence as a deferred action (deferred in system context if it needs admin privileges when the MSI is run elevated).
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 28, 2012
05:51 PM
Josh - thanks for the explanation - wondered what the heck was going on ...
i'd seen the "&featurename" mentioned in other threads but didnt know where/how to use it - now that i know, my conditions function properly ~ yay!
i'd seen the "&featurename" mentioned in other threads but didnt know where/how to use it - now that i know, my conditions function properly ~ yay!