Compile.exe

InstallShield 2020

InstallShield includes a command-line compiler that you can invoke from the Command Prompt window or from a DOS batch file. This program, called Compile.exe, is in the following folder:

InstallShield Program Files Folder/System

Note:When you build a release from the command line using ISCmdBld.exe, the build engine automatically compiles your script; therefore, you do not need to use Compile.exe directly unless you want to use compiler options that are different from those specified for the project in InstallShield. For more information, see ISCmdBld.exe.

Syntax

Compile script_file [iswi_obl_file] [isrt_obl_file] [ifx_obl_file] switches

You can pass any or all of your command-line parameters to Compile.exe in the form of a command file. To specify a command file to Compile.exe, use the following syntax:

Compile @command_file

In this example, command_file is the name of a text file, including any extension. You can specify an absolute or relative path with the file name.

You can specify all or part of the command line in a command file. You can use more than one command file in a Compile command. Compile.exe accepts the command file’s input as if it were specified in that location on the command line.

In the command file, each parameter must begin and end on the same line—you cannot use the backslash (\) to combine a parameter across two lines. In the command file, arguments can be separated by spaces or tabs (as on the command line) and by newline (\n) characters.

Parameters

The following parameters are available for use with the compiler.

Command-Line Parameters for Compile.exe

Parameter

Description

script_file

Specifies the name of the setup script. Note the following:

The file name can include a drive designation and an absolute or relative path. If the file name is unqualified, the compiler will search for the script in the current directory of the current drive.
If the specified setup script uses #include directives to include other files in the setup, and if the file names specified by #include statements do not include a path, you must specify the location of those files with the -i switch unless they reside in the current directory. Note that included files may themselves specify #include directives; be sure the -i switch specifies a search path that can be used to find all included source files.
Long path and file names must be enclosed in double quotation marks.
By default, the setup script created as part of a new InstallShield project is named setup.rul.

isrt_obl_file

Specifies the name of the library file Isrt.obl. It is not necessary to include the full path for the library file, as long as the path is identified with the -libpath switch.

Isrt.obl is in the following directory:

InstallShield Program Files Folder\Script\Isrt\Lib

This parameter is required unless you are using the -c or -l switch.

ifx_obl_file

Project:This parameter applies to InstallScript projects.

Specifies the name of the library file Ifx.obl. It is not necessary to include the full path for the library file, as long as the path is identified with the -libpath switch.

Ifx.obl is in the following directory:

InstallShield Program Files Folder\Script\Ifx\Lib

This parameter is required unless you are using the -c or -l switch.

iswi_obl_file

Project:This parameter applies to the following project types:

Basic MSI
InstallScript MSI

Specifies the name of the library file Iswi.obl. It is not necessary to include the full path for the library file, as long as the path is identified with the -libpath switch.

Iswi.obl is in the following directory:

InstallShield Program Files Folder\Script\Iswi\Lib

This parameter is required unless you are using the -c or -l switch.

ifxobject_obl_file

Project:This parameter applies to InstallScript Object projects.

Specifies the name of the library file Ifxobject.obl. It is not necessary to include the full path for the library file, as long as the path is identified with the -libpath switch.

Ifxobject.obl is in the following directory:

InstallShield Program Files Folder\Script\Ifx\Lib

This parameter is required unless you are using the -c or -l switch.

Switches

You can pass the following switches to the compiler. If you are not specifying the full path to the script files and library files, you must specify the location of the folders that contain those files by using the -i and -libpath switches (as noted in the -i and -libpath descriptions below). All of the other switches are optional.

Switches for Compile.exe

Switch

Description

/d or -d<variable name=preprocessor define>

Provides a preprocessor definition that is applicable to your InstallScript. Following is an example:

Compile.exe -dVARIABLENAME=Value

The variable name must be a valid InstallScript identifier; the value must be a constant. No space is permitted between the switch and the expression or within the expression.

If you reference the preprocessor in InstallScript, use either of the following formats:

#ifdef VARIABLENAME
#if VARIABLENAME=Value

That is, for #ifdef statements, you can use just the value name. For #if statements, use a name=value pair.

This parameter is optional.

Note:It is recommended that you use this command-line parameter only if a preprocessor is not defined in either of the following areas in InstallShield:

On the Compile/Link tab of the Settings dialog box, which is displayed when you click Settings on the Build menu
For Basic MSI and InstallScript MSI projects: In the Preprocessor Defines setting for the product configuration in the Releases view

If you define a preprocessor in either of these areas in InstallShield and then you use the -d command-line parameter to define the same preprocessor, Compile.exe displays a cannot-define-symbol message to inform you that the preprocessor cannot be redefined through an InstallShield project or product configuration setting.

/e or -e

Specifies the maximum number of error messages. The default value is 50. When the maximum number of error messages has been generated, compilation stops.

/g or -g

Specifies that a debugging information file should be produced. This file is given the name of the installation and extension .dbg.

/gi or -gi

Specifies that debugging information should be included in the compiled script file, so a debugging information file is not needed.

This option makes the compiled script larger and the installation slower, and makes it easier for others to reverse engineer your code, so it should typically not be used when creating your final installation for distribution to end users.

/i or -i<search path>

Specifies a search path—a list of paths, each separated by a semicolon—that identifies the directories to search for source files that have been included in the main installation’s InstallScript code through #include statements. Long path names must be enclosed in double quotation marks.

Project:For InstallScript and InstallScript Object projects, you must specify the full paths for the following folders:

InstallShield Program Files Folder\Script\Ifx\Include
InstallShield Program Files Folder\Script\Isrt\Include

For Basic MSI and InstallScript MSI projects, you must specify the full paths for the following folders:

InstallShield Program Files Folder\Script\Iswi\Include
InstallShield Program Files Folder\Script\Isrt\Include

The aforementioned directories contain the script header files for built-in InstallScript functionality. If you do not specify these folders, compiler errors occur.

/libpath or -libpath<path>

Specifies a single path that identifies a directory to search for libraries such as Ifx.obl, Isrt.obl, or a custom library file. To specify multiple directories, use the -libpath switch multiple times. Long path names must be enclosed in double quotation marks.

Project:For InstallScript and InstallScript Object projects, you must specify the full paths for the following folders (unless you have used the full path with the library file names):

InstallShield Program Files Folder\Script\Ifx\Lib
InstallShield Program Files Folder\Script\Isrt\Lib

For Basic MSI and InstallScript MSI projects, you must specify the full paths for the following folders (unless you have used the full path with the library file names):

InstallShield Program Files Folder\Script\Iswi\Lib
InstallShield Program Files Folder\Script\Isrt\Lib

The aforementioned directories contain the libraries that define the built-in InstallScript functions. If you do not specify these folders or the full paths with the library names, compiler errors occur.

/o or -o<compiled script file name>

Specifies the file name to assign to the compiled script. Note the following:

The file name can include a drive designation and an absolute or relative path. If a path is not specified, the compiler will store the compiled script in the current directory.
If this parameter is not specified, the compiled script is given the name of the script file and the extension .inx and is stored in the current directory.
Long path and file names must be enclosed in double quotation marks.

/q or -q

Suppresses the output of the copyright message and version information.

/v or -v

Sets the warning level to one of the following values:

0—Displays no warning messages.
1—Displays any system warning message that InstallShield is unable to handle.
2—Displays Level 1 messages, plus a message if string length exceeds the limit.
3—Displays all warning messages. This is the default setting.

/w or -w

Specifies the maximum number of warning messages. The default value is 50. When the maximum number of warning messages has been generated, compilation stops.

Additional Information

When specifying file names, you can use either short or long file names; however, long file names must be enclosed within double quotation marks.
If you specify a relative path to a file name (for example ..\..\My Functions), that path must be relative to the current directory of the current drive at the time that you invoke the compiler.

Examples

Sample Command Line for an InstallScript Project

The following command line for an InstallScript project compiles the Setup.rul script file that is located in the C:\InstallShield 2020 Projects\My InstallScript Project\script files folder:

"C:\Program Files\InstallShield\2020\System\Compile.exe"

"C:\InstallShield 2020 Projects\My InstallScript Project\script files\setup.rul"

ifx.obl

isrt.obl

-libpath"C:\Program Files\InstallShield\2020\Script\Ifx\Lib"

-libpath"C:\Program Files\InstallShield\2020\Script\Isrt\Lib"

-i"C:\Program Files\InstallShield\2020\Script\Ifx\Include"

-i"C:\Program Files\InstallShield\2020\Script\Isrt\Include"

-i"C:\InstallShield 2020 Projects\My InstallScript Project\script files"

Sample Command Line for an InstallScript MSI or Basic MSI Project

The following command line for an InstallScript MSI or Basic MSI project compiles the Setup.rul script file that is located in the C:\InstallShield 2020 Projects\My New Project\script files folder:

"C:\Program Files\InstallShield\2020\System\Compile.exe"

"C:\InstallShield 2020 Projects\My New Project\script files\setup.rul"

ISWI.obl

isrt.obl

-libpath"C:\Program Files\InstallShield\2020\Script\Iswi\Lib"

-libpath"C:\Program Files\InstallShield\2020\Script\Isrt\Lib"

-i"C:\Program Files\InstallShield\2020\Script\Ifx\Include"

-i"C:\Program Files\InstallShield\2020\Script\Isrt\Include"

-i"C:\InstallShield 2020 Projects\My New Project\script files"

See Also