Summary
This article explains how to use FeatureSetTarget to set a custom directory.Synopsis
This article is for InstallScript type projects.
FeatureSetTarget is an InstallScript function that allows you to change component and feature destinations at run time. This article explains how to use FeatureSetTarget to set a custom directory.
Discussion
Follow these steps to assign a feature or component to a custom directory and set that directory via installscript:
- Create an entry in the Directory table via the Direct Editor. The entry specified in the Directory column should be all capital letters. The directory entry used in these steps will be MYDIR.
- In the Directory_Parent column, type TARGETDIR.
- In the DefaultDir column put a dot (.). Leave the default values in the remaining columns.
- Go to the feature or component for which you want to use MYDIR as the destination. In the Destination field drop-down menu, browse to and select MYDIR.
- Go to the InstallScript view and place the following line of code in the OnFirstUIBefore event.
FeatureSetTarget(MEDIA, '<MYDIR>', 'C:\\Test');
Note: It does not matter where in the event this line is placed.
Any components or features with the destination set to MYDIR will be installed to C:\Test.
Additional Information
For more information on FeatureSetTarget, see the InstallShield HelpNet Language Reference Library topic FeatureSetTarget.
For more information on the Directory table, see the Windows MSDN Library topic Directory Table.
Related Articles
Enumerating InstallAnywhere Variables at Run Time Using Custom Code Action 6Number of Views Disabling Features at Run Time 3Number of Views Set a Directory Table Entry at Run Time 3Number of Views Accessing the MSI Database at Run Time 18Number of Views Feature Conditions Do Not Work as Expected When Based on Other Feature or Component States 5Number 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. | |
Case id: 00001065
Activity: Status change: 2 hours ago