WiseScript Package Editor Reference
40
Using Script Editor
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 18.
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
compiler variable conditions, you can easily remove them when the installation has been
debugged by changing the value of a compiler variable. The debugging actions are not
compiled into the final build.
See
Building a Debug Version
on page 113.
When to Use
z
Variable substitution can use either type of variable.
z
When a script action places a value into a variable, use a run-time variable.
Compiler variables can’t be changed by scripts, but only by the person who builds
the installation .EXE.
z
In most other instances, the type of variable to use is implicit (example: the
Compiler If script action requires a compiler variable) or is noted explicitly.
Anatomy of an Installation Script
An installation script has four basic sections. Whether you are modifying the default
script that is generated by Installation Expert or writing your own script, an
understanding of these sections can help insure that your script works correctly.
Initialization
In this section, default values for an installation are set, including the default directory,
standard components, and Start menu. Information that is needed later in the
installation is read from .INI files or the registry. Files that are displayed to the end user
(ReadMe.txt, License.txt, etc.) are installed. A search can also be performed for a
previous version of an application to use its location as the default installation directory.
User Input
This section contains a series of dialog boxes that ask the end user what optional
components to install, what directory to install the files in, and so on. This section
generally uses a Wizard Loop action. It displays any ReadMe or License files that are
installed in the Initialization section.
File Copy
This is the longest section of the installation script. Files are copied from the installation
.EXE to the destination computer.