Short Answer
You can use a path variable for the configuration-dependent, variable location of the files to install (e.g. INSTALL_FILES_PATH
) and set its value at compile time.
To set the value of a path variable at compile time, use ISCmdBld.exe
's -l <path variable>="new path"
command-line parameter - for example:
ISCmdBld.exe -l INSTALL_FILES_PATH="C:\Blah\Blah\Blah"
Further Explanation
In your project's Components or Support Files/Billboards views where you specify files the installer needs, the files' paths (in the Link To column) will leverage the path variable (if it is set to a valid value when you specify the files at design time). This is the key to the path variable's compile-time value affecting where to find the files.
The InstallShield GUI only makes this clear in the Support Files/Billboards view (e.g. showing <INSTALL_FILES_PATH>\SomeFile.blah
rather than C:\Blah\Blah\Blah\SomeFile.blah
), but you can confirm that both the Components and Support Files/Billboards views leverage the path variable in your project's .ism
file - for example:
<!-- ** Example 1 - a dynamic file link for DefaultComponent ** -->
<table name="ISDynamicFile">
<col key="yes" def="s72">Component_</col>
<col key="yes" def="s255">SourceFolder</col>
<col def="I2">IncludeFlags</col>
<col def="S0">IncludeFiles</col>
<col def="S0">ExcludeFiles</col>
<col def="I4">ISAttributes</col>
<!-- * Notice the INSTALL_FILES_PATH path variable in the following file link. * -->
<row><td>DefaultComponent</td><td><INSTALL_FILES_PATH></td><td>1</td><td>*.*</td><td/><td>2</td></row>
</table>
<!-- ** Example 2 - a support file link for Disk1 ** -->
<table name="ISDisk1File">
<col key="yes" def="s72">ISDisk1File</col>
<col def="s255">ISBuildSourcePath</col>
<col def="I4">Disk</col>
<!-- * Notice the INSTALL_FILES_PATH path variable in the following file link. * -->
<row><td>NewDisk1File1</td><td><INSTALL_FILES_PATH>\SomeFile.blah</td><td>1</td></row>
</table>
Component file links that leverage the path variable will "bubble up" to your project's Files and Folders view - even though the InstallShield GUI will not reveal as much (e.g. showing C:\Blah\Blah\Blah\SomeFile.blah
rather than <INSTALL_FILES_PATH>\SomeFile.blah
in the Link To column - just like the Components view).