PDA

View Full Version : Checking selected features



Raffee
09-20-2013, 10:16 AM
How can I check which features are selected to be installed? (Basic MSI project).
Strangely, IS allows me to link SQL Scripts and files to specific features, but not custom actions and IIS components (App Pools, Virutal Directories, etc...)

When creating custom actions we can set a condition, so I thought maybe I can have a condition like "IF FEATURE X SELECTED"
How can I accomplish this?

rguggisberg
09-20-2013, 10:26 AM
In regard to the IIS question...
[Corrected] Just make sure the selected component is associated with the desired feature.
Don't really need the second screen shot below... but I don't see how to delete it!
10222

Raffee
09-20-2013, 10:57 AM
Thanks :) this seems to work.
IT looks like I can't do the same to custom actions and dialogs, since they are not registered as components, yeah? Is there a workaround?

rguggisberg
09-20-2013, 11:01 AM
How can I check which features are selected to be installed? (Basic MSI project).
Strangely, IS allows me to link SQL Scripts and files to specific features, but not custom actions and IIS components (App Pools, Virutal Directories, etc...)

When creating custom actions we can set a condition, so I thought maybe I can have a condition like "IF FEATURE X SELECTED"
How can I accomplish this?

To determine if a feature is selected do something like this in your CA..
if (MsiEvaluateCondition(hMSI,"Not Installed And &YourFeatureName=3") = MSICONDITION_TRUE ) then

rguggisberg
09-20-2013, 11:10 AM
Thanks :) this seems to work.
IT looks like I can't do the same to custom actions and dialogs, since they are not registered as components, yeah? Is there a workaround?

For Dialogs you can add a condition to the 'NewDialog' Event (this is typically on the 'Next' button of the previous dialog). A condition might look like this:

(FEATURE_SELECTION_IS_VALID="1") AND &YourFeatureName=3