robwirving
Posts: 2
Joined: Fri Jul 07, 2017 8:47 pm

Trigger Custom Action only if Feature installed

I want to run an inline powershell script that will write to an xml file that is installed. What the script will write will depend on which optional features have been installed by the user. What's the best way to do this?

Can I trigger the custom action only to run if a certain optional feature has been installed?
Can I pass a list of feature ids that were installed into the powershell script?
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Trigger Custom Action only if Feature installed

Hello and welcome to our Forums,
Can I trigger the custom action only to run if a certain optional feature has been installed?
Yes, this cand be done by using the following condition on an "Execute custom action" publish event on the next button of the "OptionalFeatsDlg":

Code: Select all

((&Feature1 = 3) AND NOT (!Feature1 = 3))
where "Feature1" is the feature's identifier.
Can I pass a list of feature ids that were installed into the powershell script?
For this you could use ADDLOCAL property
This property will contain the IDs of the features to be installed.

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”