How do I enable the end user to execute the installed program from a checkbox on the Exit Dialog?
To execute an installed program from a checkbox on the Exit Dialog, you must install the program, create a custom action to execute the program and customize the dialog to launch the program based on the state of a checkbox.
To install the program, add files to the installation on the Installation Expert Page. Add notepad.exe from the Windows directory to create a sample for this article.
To create a custom action to execute the program:
1. Select All Custom Actions from the Installation Mode drop-down list in MSI Script.
2. Double-click on the Execute Program From Installed Files custom action. The Execute Program From Installed Files dialog appears.
3. Complete the fields on the Execute Program From Installed Files dialog as follows:
* Custom Action Name: The name of the custom action.Example: ExecuteNotepad
* Executable File: Click Browse. The Select File dialog appears. Locate the appropriate file (example: notepad.exe) and click OK to close the Select File dialog.
* Command Line Arguments: The command line arguments to apply at execution time. Example: Leave this field blank
4. Complete the fields on the Properties tab as follows:
* In-Script Options: The sequence in which the custom action should execute. * Example: Select Immediate Execution from the drop-down list
* Processing: Determines whether the installation waits for completion and whether to process return codes. Example: Select Asynch, No wait from the drop-down list
* Scheduling Options: Determines when to execute the custom action if it exists in both the User Interface and Execute sequences. Example: Select Always Execute from the drop-down list.
* Progress Bar Text: The progress message to display during execution of the custom action. Example: Leave this field blank
5. Click OK to close the Execute Program From Installed Files dialog.
To create a checkbox control on the Exit Dialog:
1. Select the Exit Dialog from the Dialogs tab in Setup Editor.
2. In the right pane, right-click on the Exit Dialog and select Add > Checkbox. The Properties for Checkbox dialog appears.
3. Click the New button beside the Property field. The Property Details dialog appears.
4. Complete the fields on the Property Details dialog as follows:
* Name: The name of the property. Example: EXECUTE
* Value: The value of the property. Example: 1
5. Click OK to close the Property Details dialog.
6. Input text to display to the end user in the Control Text field. Example: Execute Notepad
7. Click OK to close the Properties for Checkbox dialog.
8. Move and resize the checkbox as necessary.
To modify the Finish button to execute the program based on a condition:
1. Double-click the Finish button. The Properties for PushButton dialog appears.
2. Click the Add button in the Published Events section on the Events tab. The Publish Event Details dialog appears.
3. Complete the fields on the Publish Event Details dialog as follows:
* Event: The event to execute. Example: DoAction
* Argument: The name of the custom action. Example: ExecuteNotepad
* Condition: The condition under which the custom action executes. Example: EXECUTE=1 (This condition is true if the end user marks the checkbox added above.)
4. Click OK to close the Publish Event Details dialog.
5. Click OK to close the Properties for PushButton dialog.
Compile and run the installation. For this example, if the end user marks the checkbox, Notepad executes after the end user clicks the Finish button.