InstallShield 2015 » InstallScript Language Reference
Preprocessor directives are instructions to the InstallScript compiler that are executed as the script is compiled. Preprocessor directives can instruct the compiler to include other source files in the compilation, to define constants, to include or exclude statements based on compile-time conditions, and to display a user-defined error message. Although InstallScript directives are similar to directives in the C language, they are not exactly alike.
Preprocessor directives begin with a pound sign (#) and can be inserted anywhere in a script. Each directive must appear on a line by itself and must not be terminated with a semicolon.
Using Preprocessor Directives
Use the following guidelines when using preprocessor directives in your script. A preprocessor directive meets the following conditions:
• | It does not end with a semicolon. |
• | It cannot line wrap. |
• | It must be less than 250 characters in length. |
Note: The expressions used in conditional directives can include constants that have been defined with the #define directive. They cannot include variables.
Using Boolean Operators with Preprocessor Directives
The following Boolean operators are supported in #if, #ifdef, #ifndef, and #elif statements:
• | Logical OR ( || ) |
• | Logical AND ( && ) |
• | Relational ( =, !=, >, >=, <, <= ) |
InstallScript-Supported Preprocessor Directives
InstallScript supports the following preprocessor directives:
Preprocessor Directive |
Description |
Creates a symbolic constant. |
|
Combines #else and #if into one statement. |
|
Indicates alternatives if the test fails. |
|
Ends a preprocessor conditional directive (#if, #ifdef, #ifndef). |
|
Displays a user-defined error message. |
|
Compiles if the conditional statement is true. |
|
#ifdef |
Compiles if a numeric constant is defined. |
#ifndef |
Compiles if a numeric constant is not defined. |
Includes the contents of another file. |
|
Undefines a constant that was defined previously with #define. |
|
Display a compiler warning and a user-defined error message. |
See Also
Defining Constants Through the Compiler
InstallShield 2015 Help LibraryJune 2015 |
Copyright Information | Contact Us |