Using Preprocessor Statements to Debug the Script
InstallShield 2020
Use the #define and #ifdef statements to create an internal debugger in the script.
To deug a script by using the preprocessor statements:
1. | Wherever you want to insert a debug statement in the script, start with the following #ifdef directive: |
#ifdef DEBUG
2. | On lines that follow that directive, type the debug statements. |
3. | On a separate line after the debug statements, type: |
#endif
4. | For debugging purposes, compile the following compiler setting: |
DDEBUG=1
Here is an example of a debugging section using an #ifdef statement:
#ifdef DEBUG
if nResult < 0 then
WriteLine (LogFileHandle, "PlaceBitmap failed");
endif;
#endif
The InstallScript Debugger enables you to trace program execution and inspect variables as your installation executes.