WiseScript Editor Reference
29
See also:
Compiler Variables and Run-time Variables
on page 29
Basic Scripting Concepts
on page 26
Compiler Variables and Run-time Variables
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 by prompting you. 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.
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.
Содержание ALTIRIS INVENTORY 7.0 SP2 - FOR NETWORK DEVICES V1.0
Страница 1: ...WiseScript Editor Reference ...
Страница 31: ...WiseScript Editor Reference 31 ...
Страница 91: ...WiseScript Editor Reference 91 ...
Страница 148: ...WiseScript Editor Reference 148 ...