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

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?
Labels (1)
0 Kudos
(2) Replies
krisbg
Level 2

Any idea on this one?
0 Kudos
KathyMorey
Level 10

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.
0 Kudos