WiseScript Package Editor Reference
109
Using Script Editor
Using the Debug Commands
on page 106
Basic Scripting Concepts
If you do not have a basic understanding of scripting concepts, you should become
familiar with them before trying to write a WiseScript.
See:
About Script Editor
on page 94
Conditions and Loops
on page 109
Variables and Expressions
on page 110
Compiler Variables and Run-time Variables
on page 111
Anatomy of an Installation Script
on page 112
About Components
on page 113
Conditions and Loops
Normally, script actions are executed in the order in which they appear in the script.
However, the order of execution can be changed by special script actions called
conditions and loops.
Conditions specify script actions that are executed only when certain conditions are true.
Example: In WiseScript, you can test what version of Windows a destination computer is
running, then execute different script actions depending on the version of Windows
they’re running.
Loops specify script actions that are repeated until a certain condition is met. Example:
You might prompt the end user to enter specific information during installation. To make
sure the information the end user enters meets certain criteria, use a loop to repeat the
prompt until the data entered is appropriate.
If, While, and End Actions
Because a condition or loop can apply to more than one script action, they are defined
using at least two statements: one to mark the beginning of the block of script and the
other to mark its end. The standard action for beginning a condition is the If action, and
the standard action for beginning a loop is the While action. The end of both conditions
and loops is marked using the End action. Script Editor indents everything inside a
condition or loop so you can see which actions are affected.
Else and ElseIf Actions
Conditions can use the Else and ElseIf actions, which mark the beginning of actions to be
executed when the condition described by the If action (or other condition statement) is
not true. The Else action is used between the If and End actions. Actions after the If but
before the Else are executed if the condition is true. Actions after the Else are executed
if the condition is false. Loops cannot have Else statements.
Nesting
In WiseScript, one condition or loop can contain another condition or loop. This is called
nesting. You define a nested condition or loop by adding a second If or While action (or
other start-of-condition or start-of-loop marker) before the End action of the first
condition or loop. The second block of script must be fully contained within the first.
When you add an End action, it always applies to the most recently begun If or While
Содержание WISESCRIPT PACKAGE EDITOR 8.0
Страница 1: ...WiseScript Package Editor Reference ...