Summary
This article explains how to launch an executable from a subdirectory of SOURCEDIR.
Synopsis
This article explains how to launch an executable from a subdirectory of SOURCEDIR. The article applies to Basic MSI Project Type.
Discussion
Launching the executable requires three basic steps:
- Resolve the
SOURCEDIRproperty. - Set the property containing the full path to the executable.
- Launch the executable.
Use these specific steps to do this in your installation:
- Resolve the
SOURCEDIRproperty.- In the Sequences view, expand the tree to view the Execute sequence under the Installation sequence.
- Insert the ResolveSource standard action in the sequence somewhere before the location where you'll be calling your custom action and after the CostInitialize action. Set the condition for this action to Not Installed.
- Set the property containing the full path to the executable.
- Navigate to the Property Manager in the Project view.
- Create a new property (for example, ThirdPartyExe).
- In the Actions/Scripts view, right-click on the Custom Actions item and select Custom Action Wizard?
- On the Basic Information panel, give your custom action a name (for example SetThirdPartyExeProperty). Click Next.
- On the Action Type panel, select a Type of "Set a Property." Click Next.
- On the Action Parameters panel, in the Source combo box, select the property you created in step 2.
- While still on the Action Parameters panel, enter [SourceDir]subdir1\subdir2\the.exe.
NOTE: Do not use a backslash (\) between [SourceDir] and the first subdirectory. [SourceDir] already contains the trailing backslash. Click Next and finish the wizard.
- In the Sequences view, insert your custom action (for example the SetThirdPartyExeProperty) into the Installation\Exexute sequence in the appropriate location. Make sure that it is after the ResolveSource action. Set the condition for this action to Not Installed.
- Launch the executable.
- In the Actions/Scripts view, right-click on the Custom Actions item and select Custom Action Wizard.
- On the Basic Information panel, give your custom action a name (for example, RunThirdPartyExe). Click Next.
- On the Action Type panel, select a Type of "Launch an executable" and a Location of "Stored in the Property table." Click Next.
- On the Action Parameters panel, in the Source combo box, select the property you created in step B2 (for example, ThirdPartyExe).
- While still in the Action Parameters panel, enter any command-line parameters (for example, -s for silent) in the Target field. Click Next to finish the wizard.
- Insert your custom action (for example, RunThirdPartyExe) into the sequence in the appropriate location. Make sure that it is after the custom action you created in section B (for example, the SetThirdPartyExe property). Set the condition for this action to Not Installed.
NOTE: All of the actions were inserted into the sequence with Not Installed as the condition. This is to ensure that the actions are only run when the source is available. This is usually the case only during the initial installation.
If working with a release that generates a setup.exe file, it is recommended to reference SETUPEXEDIR instead of SourceDir because SourceDir will not evaluate to the expected location when working with a single setup.exe release.
An alternate approach is to use the Windows API GetModuleFileName() to find the location of your running exe.
Additional Information
The SETUPEXEDIR property is further documented in the Help Library.
Related Articles
Windows Loads a Different Library or Launches a Different Executable than was Intended by the Author of a InstallShield Se… 57Number of Views Launch an Executable from the Support Files Location Using InstallShield 6Number of Views Launch an Executable Using a Custom Action 4Number of Views SourceDir and SRCDIR Resolve to a Location Under Temp Directory 6Number of Views Launch a Custom Executable 18Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
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. | |
Revenera Assistant
Case id: 00001065
Activity: Status change: 2 hours ago