Summary
It is necessary to create a new custom action in order to set the working directory when launching an executable at the end of an installation.Synopsis
By default, the functionality in InstallShield for launching the application at the end of the installation does not set a working directory. It is necessary to create a new custom action in order to set the working directory for the launched executable.
Discussion
The following steps can be followed in order to configure the installation to conditionally launch an executable (based on a check box).
Windows Installer Projects
-
Create a new Basic MSI project
-
In the Project Assistant tab, select the Application Files view and add an .exe file and any necessary files.
-
Select the Installation Interview view and select "Yes" to "Do you want to give users the option to launch your application when the installation completes?" This will automatically add an exe custom action to launch the specified application based on a checkbox.
-
By default, the LAUNCHPROGRAM property tied to the condition of the custom action has no value, and so the check box appears deselected by default at run time. To specify that the check box should be initially selected, you can add LAUNCHPROGRAM to the Property Manager view with value 1.
-
In the Releases view, under the Setup.exe tab for your release, set the Required Execution Level setting to Administrator.
- Save, build and test.
For an InstallScript project, you add the option to launch the application by modifying the OnFirstUIAfter event handler. By default, the OnFirstUIAfter event handler contains an if statement that checks whether a reboot is necessary and whether you included Update Service support, and displays the appropriate completion dialog box. The possible completion dialog boxes are SdFinishReboot, SdFinishUpdateEx, and SdFinish. In most cases, SdFinish is the dialog box you will want to modify.
In the default implementation of OnFirstUIAfter, the branch of the if statement that displays SdFinish appears simply as follows:
SdFinish(szTitle, szMsg1, szMsg2, szOpt1, szOpt2, bvOpt1, bvOpt2);To enable the check box with appropriate text, and launch your application if the user selects the check box, you can modify the branch of the if statement to appear as follows:
bvOpt1 = TRUE; // enable check box
szOpt1 = "Launch %p"; // %p expands to product name
SdFinish(szTitle, szMsg1, szMsg2, szOpt1, szOpt2, bvOpt1, bvOpt2);
if (bvOpt1) then
LaunchApp(TARGETDIR ^ "sample.exe", "");
endif;
(In practice, you should use a string-table entry instead of a hard-coded string for szOpt1, to ease localization of your installation project.)At run time, the dialog box appears as follows.
Additional Information
The Project Assistant is used in this example to quickly and easily create the checkbox required for a conditional launch. If a developer is comfortable with modifying Windows Installer dialogs, the Project assistant steps can be skipped and the dialog edited manually.For more information on custom actions see the HelpNet article Custom Action Wizard .
Was this helpful?
Related Articles
Launching an HTML Page During Installation 3Number of Views Installing An Uninstallation Shortcut To The Programs Menu 4Number of Views Installer built with the InstallShield SAB displays text in English instead of Arabic or Ukrainian 18Number of Views Create a Shortcut Using Installscript Based on User Input and Delete The Shortcut on Uninstalling The Installer 8Number of Views Error Reading Setup Initialization File when Launching a Compressed Setup.exe 13Number of Views
Revenera Assistant
Online
Hi, I am Reva - Ask me anything.
Updates
No new updates
Chat
Home
Updates
/**/
Thanks for the feedback!
Your feedback has been saved.Rate this response:
1
2
3
4
5
Add Additional feedback ( Optional )
0/240
English
English
Language changed successfully
Something went wrong
Email sent successfully
Something went wrong
Case create successfully
Are you sure you want to cancel
the case creation?
Please select a product to submit the case.
Please select a product version to submit the case.
0/255
Upload Attachment
File Upload
Maximum file
size allowed is 3 MB.
File type
not supported.
Supported file types:
Documents (.txt, .doc, .docx, .pdf), Images (.jpg, .png), Comma Separated Files
(.csv) Speadsheets (.xlsx, .xls)
Are you sure you want to cancel the case creation?
Case closed successfully
File Upload
Maximum file size allowed is 3 MB.
File type not supported.
Supported file types:
Documents (.txt, .doc, .docx, .pdf), Images (.jpg, .png), Comma Separated Files
(.csv) Speadsheets (.xlsx, .xls)
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
File Upload
Maximum file
size allowed is 3 MB.
File type
not supported.
Supported file types:
Documents (.txt, .doc, .docx, .pdf), Images (.jpg, .png), Comma Separated Files
(.csv) Speadsheets (.xlsx, .xls)
© 2026 Flexera Software. All Rights Reserved.
Case id: 00001065
Activity: Status change: 2 hours ago