1

Is it possible in InstallScript to define a script that given a path as an argument to the command-line compiler, will look in that path and get the files to be installed from there before compiling and building the installer?

The goal is to be able to build using the command line, an installer that can install the files from the release folder, and for debugging purposes, the same files (same names) but from a debug directory

I couldn't find a way of setting the Files and Folders in the Application Data section of the Installation Designer

Thanks

La bla bla
  • 8,558
  • 13
  • 60
  • 109

2 Answers2

0

I think you can use a custom dialog and script to resolve this issue.

First, you add both the Release and Debug folders to Files and Folders. Then, you create a custom dialog with 2 choices - Release and Debug - and write a script to delete the Debug folder if Release is chosen in the custom dialog or delete the Release folder if Debug is chosen in the custom dialog.

J0e3gan
  • 8,740
  • 10
  • 53
  • 80
Nho Le
  • 44
  • 6
  • Thanks, Can you please explain how do I modify the Files and Folders option from within a script? – La bla bla Mar 11 '14 at 08:59
  • I don't understand. What's the **Files and Folders option**? What's your idea? I need more detail. – Nho Le Mar 11 '14 at 10:42
  • I think @Lablabla means how to modify options set in the Files and Folders view of the InstallShield GUI in a script; but this is unnecessary for the effect he wants to achieve as I explain in my answer. – J0e3gan May 17 '14 at 21:54
  • If whether to install debug or release files was an _install-time_ decision, then this might be an appropriate suggestion; but it is unnecessary if whether to install debug or release files is a _compile-time_ decision like @Lablabla describes. – J0e3gan May 17 '14 at 22:01
0

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>&lt;INSTALL_FILES_PATH&gt;</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>&lt;INSTALL_FILES_PATH&gt;\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).

J0e3gan
  • 8,740
  • 10
  • 53
  • 80