Summary
Custom Action SourceDirSynopsis
How to configure a custom action to run from SourceDir by first setting up a preliminary action transferring SourceDir's value to another property.
Discussion
- Create a public property in the Property Manager, leaving its value as 0. Public properties have names with all uppercase characters.
- Select the Support Files view.
- Select the Disk1 node, right-click and select Insert Files. Browse to the File the custom action will launch.
- Select the Custom Actions view.
- Right-click on Custom Actions and select Custom Action Wizard.
- In the Action Type dialog, set the Type to Set a Property.
- In the Action Parameters dialog, set the Source to the property created in step 1 and set the Target to [SourceDir]Name of File Included in Step 3.
- In the Insert into Sequence dialog, set this action's Install UI Sequence attribute to After ResolveSource. ResolveSource is the action that sets the SourceDir property. Set the Install UI Condition to Not Installed.
- Create a second custom action to call the file included in Step 3 using the Custom Action wizard.
- In the Action Type dialog, set the Location to Stored in the Property table.
- In the Action Parameters dialog, set the Source to the property created in step 1.
- In the Insert into Sequence dialog, set the Install UI Sequence attribute to run after the action created in step 6. Set the Install UI Condition to Not Installed.
Additional Information
The custom action created in Step 12 can be launched at any point in the sequence after the custom action created in Step 6. This can be adjusted by changing the Install UI Sequence or Install Exec Sequence attributes.
If you plan to run the installation silently, you will need to add the ResolveSource action to the Execute Sequence. This can be accomplished by following these steps:
- In the Sequences view under the Installation sequence, expand the Execute sequence.
- Right-click the CostInitialize action and select Insert.
- From the drop-down list, select Standard Actions.
- From the list, select ResolveSource.
- In the Condition field, type Not Installed.
- Schedule the other two custom actions (described in Steps 6 and 12) sequentially after ResolveSource.
Note that all actions were added with the condition of Not Installed. 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. SETUPEXEDIR can also be referenced directly and does not require the workaround described in this article.
The SETUPEXEDIR property is further documented in the Help Library.
The SourceDir property is also briefly documented in the Microsoft Windows Installer Help.
Related Articles
Adding a Custom Action's Progress to the Progress Bar 5Number of Views Writing to the Log File from a Custom Action in an MSI 13Number of Views Can I Launch a Custom Action from SUPPORTDIR in Express? 5Number of Views InstallScript : How to Store an Error Code From a Custom Action 12Number of Views PowerShell cmdlet get-property Used in a Custom Action 6Number 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