How do I create a condition that only executes an .exe if a certain component is installed?
The following steps will allow you to create a condition that only runs an .exe if a specific component is installed. From the MSI Script > Execute Immediate section (this may vary depending the location of your Custom Action):
- Add an IF Statement before the custom action that calls the .exe.
- The IF Statement Settings dialog appears. Click the Build button.
- The Condition Builder dialog appears. In the Fields column, select the Component folder under Objects.
- Select the Component Name that contains the .exe and Action under the State column. Then, click the Paste button for the component name to appear in the upper white field which is called the condition field.
- Click the equal sign button to add an = sign after the Component name in the Condition field.
- Then, click Local to appear after the equal sign in the Condition field.
- Click OK and the dialog returns to the If Settings Dialog. The results of the condition builder should be as follows= Result $<Name of Component>= 3.
- Click OK and then add an End Statement after the custom action.
Imported Document Id