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
- :
- Custom action not setting selected features
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
‎Sep 11, 2009
12:38 PM
Custom action not setting selected features
Basic MSI project (the first for me, so may be I am doing stupid things).
I have two features and they are mutually exclusive - when the first is selected the second shouldn't be selected and vice versa.
I found some solutions here on the forum and tried to follow them:
Made a custom dialog with two radio buttons in a radio button group. The value of the first button is 1 and the value of the second is 2.
Made an Install Script Custom Action which is fired on the Next button of my custom dialog with the two radio buttons. In the script of this custom action I read the property of the radio button group and then set another property which is present in the Condition of each Feature where depending on that property I change the Install Level of the feature in order to exclude it from the setup depending on the radio button selection. I am sure that the custom action fires because I put some logging and it shows that the correct value is coming from the radio button property. The problem is that since I still haven't removed the Setup Types dialog from my template project, I don't see any feature selected and of course nothing gets installed.
But, if in addition I put the same custom action to be executed not only on the Next button of my custom dialog, but also in the User Interface sub-sequence of my Installation Sequence (BEFORE the CostFinalize action) I get selected and installed the feature depending on the value of the radio button property which was selected in the properties table during design time. Unfortunately in that case although the same custom action is fired on the Next button of my custom dialog, the selection doesn't change - it stays the same as initially. If I move the additional execution of my custom action AFTER CostFinalize it doesn't select any feature. So, I think the problem with my main custom action is that the dialogs are executed AFTER CostFinalize. How can I get around this?
I have two features and they are mutually exclusive - when the first is selected the second shouldn't be selected and vice versa.
I found some solutions here on the forum and tried to follow them:
Made a custom dialog with two radio buttons in a radio button group. The value of the first button is 1 and the value of the second is 2.
Made an Install Script Custom Action which is fired on the Next button of my custom dialog with the two radio buttons. In the script of this custom action I read the property of the radio button group and then set another property which is present in the Condition of each Feature where depending on that property I change the Install Level of the feature in order to exclude it from the setup depending on the radio button selection. I am sure that the custom action fires because I put some logging and it shows that the correct value is coming from the radio button property. The problem is that since I still haven't removed the Setup Types dialog from my template project, I don't see any feature selected and of course nothing gets installed.
But, if in addition I put the same custom action to be executed not only on the Next button of my custom dialog, but also in the User Interface sub-sequence of my Installation Sequence (BEFORE the CostFinalize action) I get selected and installed the feature depending on the value of the radio button property which was selected in the properties table during design time. Unfortunately in that case although the same custom action is fired on the Next button of my custom dialog, the selection doesn't change - it stays the same as initially. If I move the additional execution of my custom action AFTER CostFinalize it doesn't select any feature. So, I think the problem with my main custom action is that the dialogs are executed AFTER CostFinalize. How can I get around this?
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 14, 2009
03:02 AM
Any idea on this one?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 14, 2009
09:12 AM
Feature and components states are set by CostFinalize. If you want to control selection from a dialog as you mentioned, try this:
1. Take the feature conditions off and set the InstallLevel so they both install.
2. In the Next button of your custom dialog, use the radio button property to add the selected feature to the ADDLOCAL property and add the unselected feature to the REMOVE propery.
1. Take the feature conditions off and set the InstallLevel so they both install.
2. In the Next button of your custom dialog, use the radio button property to add the selected feature to the ADDLOCAL property and add the unselected feature to the REMOVE propery.
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)