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
- :
- Hide Features in Custom Setup Dialog by Property [Basis MSI]
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
‎May 19, 2013
04:59 AM
Hide Features in Custom Setup Dialog by Property [Basis MSI]
Hello,
I 've got a Basic MSI Project which installs different Features and want to hide some Features when property xyz is set.
For understanding: the Setup should be used to install a serverapplication or a clientapplication.
I created a new Dialog and put on two radio guttons in a radio button group and set property to "xyz"
- Radio button 1 -> value 0
- Radio button 2 -> value 1
Features (all installlevel 1):
- Feature1
- Feature2
- Feature3
- Feature4
Feature1 should be only shown by selecting server-setup (xyz=0) and not shown when client-setup (xyz=1) was selected.
So i create a condition in Feature-section for Feature1 like this:
Level: 0 xyz=1
this solution only works if property was set by default but not while running setup.
[in Custom Setup Dialog the Features also shown 😞 ]
I checked with an installScript if the Property set correctly and also tried to create an installscript to disable and hiding Feature with "FeatureSetData" and "FeatureSelectItem" without success.
How can I solve this problem? Other ways are also welcome 😉
----
Thanks for your response
I 've got a Basic MSI Project which installs different Features and want to hide some Features when property xyz is set.
For understanding: the Setup should be used to install a serverapplication or a clientapplication.
I created a new Dialog and put on two radio guttons in a radio button group and set property to "xyz"
- Radio button 1 -> value 0
- Radio button 2 -> value 1
Features (all installlevel 1):
- Feature1
- Feature2
- Feature3
- Feature4
Feature1 should be only shown by selecting server-setup (xyz=0) and not shown when client-setup (xyz=1) was selected.
So i create a condition in Feature-section for Feature1 like this:
Level: 0 xyz=1
this solution only works if property was set by default but not while running setup.
[in Custom Setup Dialog the Features also shown 😞 ]
I checked with an installScript if the Property set correctly and also tried to create an installscript to disable and hiding Feature with "FeatureSetData" and "FeatureSelectItem" without success.
How can I solve this problem? Other ways are also welcome 😉
----
Thanks for your response
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 22, 2013
10:57 AM
tteonline wrote:
Hello,
I 've got a Basic MSI Project which installs different Features and want to hide some Features when property xyz is set.
For understanding: the Setup should be used to install a serverapplication or a clientapplication.
I created a new Dialog and put on two radio guttons in a radio button group and set property to "xyz"
- Radio button 1 -> value 0
- Radio button 2 -> value 1
Features (all installlevel 1):
- Feature1
- Feature2
- Feature3
- Feature4
Feature1 should be only shown by selecting server-setup (xyz=0) and not shown when client-setup (xyz=1) was selected.
So i create a condition in Feature-section for Feature1 like this:
Level: 0 xyz=1
this solution only works if property was set by default but not while running setup.
[in Custom Setup Dialog the Features also shown 😞 ]
I checked with an installScript if the Property set correctly and also tried to create an installscript to disable and hiding Feature with "FeatureSetData" and "FeatureSelectItem" without success.
How can I solve this problem? Other ways are also welcome 😉
----
Thanks for your response
You are probably already aware of this, but to simply turn Features on and Off, set your feature’s InstallLevel property to 101 so they will not be installed by default and add a custom action to turn your Feature(s) on based on the results of your Property from your custom dialog. Trigger the custom action on the Next button of your dialog -
//In InstallScript, handle Feature activation as follows:
//To set the Feature to off:
MsiSetFeatureState(hMSI, "MyFeature", INSTALLSTATE_ABSENT);
//To Set Feature States:
MsiSetFeatureState(hMSI, " MyFeature ", INSTALLSTATE_LOCAL);
//Condition the feature in your custome action
if (myPropertyValue = "SomeValue") then
MsiSetFeatureState(hMSI, " MyFeature ", INSTALLSTATE_LOCAL);
endif;
//Set the Next button on your custom dialog to trigger the custom action
Event Argument Condition
DoAction SetFeatureStates 1
If you want to make the Feature invisible in the Custom View, it gets more difficult -
Conditioning is similar but it is necessary to set the Display property of the direct editor table for the Feature in question to a value of 0. Not real easy but I believe it can be done. Is it workable for you to make the property invisible all the time and then turn it on or off depending on you dialog?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 29, 2013
05:16 AM
Thanks for your replay, i didn't recorgnizes it until yet 😞
Yes, that's possible!
Setting Feature to install Level 0 is possible but how can I set the Feature back to visible?
I created a Custom Action and run this to set visibility and selected to true (FeatureName = Name of Feature like in Features-table):
FeatureSetData (MEDIA, "FeatureName", FEATURE_FIELD_VISIBLE, TRUE, szData);
FeatureSelectItem(MEDIA, "FeatureName", TRUE);
it doesn't work! Is this command usable if I use Basic MSI and run it with a install script?
I also tried to check the features state with FeatureGetData but this will return a value less than 0 (=error).
ITI_Randy wrote:
Conditioning is similar but it is necessary to set the Display property of the direct editor table for the Feature in question to a value of 0. Not real easy but I believe it can be done. Is it workable for you to make the property invisible all the time and then turn it on or off depending on you dialog?
Yes, that's possible!
Setting Feature to install Level 0 is possible but how can I set the Feature back to visible?
I created a Custom Action and run this to set visibility and selected to true (FeatureName = Name of Feature like in Features-table):
FeatureSetData (MEDIA, "FeatureName", FEATURE_FIELD_VISIBLE, TRUE, szData);
FeatureSelectItem(MEDIA, "FeatureName", TRUE);
it doesn't work! Is this command usable if I use Basic MSI and run it with a install script?
I also tried to check the features state with FeatureGetData but this will return a value less than 0 (=error).