Compiler Variables And Run-Time Variables - Symantec WISESCRIPT EDITOR 8.0 - REFERENCE FOR WISE PACKAGE STUDIO V1.0 Reference

Table of Contents

Advertisement

Compiler Variables and Run-time Variables

WiseScript Editor Reference
When They Are Set
WiseScript uses two kinds of variables: compiler and run-time. When you start a compile
by clicking the Compile, Test, or Run button, the values of compiler variables are set
immediately, either by prompting you or by reading the values from the Compiler
Variables page. Script Editor then searches the entire script and replaces any instance of
the compiler variable with the value. These variables cannot be changed by end users
who run the installation .EXE.
Run-time variables are set by selections the end user makes on the installation's dialog
boxes, by characteristics of their computer, or by the contents of files on their hard disk
(example: a settings file, an .INI file, or the registry).
The difference between compiler variables and run-time variables is similar to the
difference in C programming between preprocessor variables and C language variables.
Preprocessor <#ifdef> statements determine which code is compiled. C language If
statements determine which code is executed at run time.
In Conditions and Expressions
You can use both types of variables in variable substitution. However, they have
distinctly different behaviors when used in conditions and expressions. When you enter
a regular variable into an expression, you do not need to surround it with % signs, but
when you enter a compiler variable in an expression, you must surround the compiler
variable with % signs.
With a condition based on run-time variables, all the script actions required by the
condition are included in the installation .EXE. WiseScript Editor doesn't know which part
of the condition will be executed until the installation .EXE is run because it depends on
variables whose values are not known until run time. The values of compiler variables,
on the other hand, are known when the installation .EXE is built. Therefore, WiseScript
Editor does not include the script actions inside a compiler variable condition when
building the installation .EXE.
Naming Compiler Variables
By convention, the names of compiler variables begin and end with an underscore.
WiseScript does not enforce this convention, but it might help you keep track of which
variables are known at compile time and which are known only at run time.
Using Compiler Variables
If an Install File(s) action is included inside a Compiler Variable If block, the file it installs
is not added to the installation .EXE if the condition is false.
See
Compiler Variables
on page 17.
Example: You can create a script that compiles an installation .EXE for either a 16-bit or
32-bit version of your application based on the value of a compiler variable and includes
only the files needed by each version of the application. Because the Install File(s)
actions that install the other version of the application are not compiled, those files are
not in the installation .EXE, making it smaller than a universal installation for both 16-bit
and 32-bit systems.
You can also use compiler variables to create a debug version of your script that
includes Display Action messages to display run-time variable values and other useful
information at various points in the installation. By enclosing your debugging actions in
Using Script Editor
34

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the WISESCRIPT EDITOR 8.0 - REFERENCE FOR WISE PACKAGE STUDIO V1.0 and is the answer not in the manual?

This manual is also suitable for:

Wisescript editor 8.0

Table of Contents

Save PDF