If Statement - Symantec WISESCRIPT EDITOR 8.0 - REFERENCE FOR WISE PACKAGE STUDIO V1.0 Reference

Table of Contents

Advertisement

If Statement

WiseScript Editor Reference
To complete the dialog box
Message Text
Enter a message to display to the user if the compile is stopped.
Example: You develop a script that uses runtime files. On your own computer, you have
the correct runtime files to pull into the installation. However, you want to prevent
compilation on other computers if they lack correct runtime files because the resulting
installation could damage runtime installations on destination computers.
You do this by adding a Compiler Variable If/Else/End block. You get the file version of a
key runtime file using the file version option of a Compiler If statement. Then, if the file
version is not the one the script requires, use the Halt Compilation action to prevent
compilation.
This action marks the beginning of a conditional block of script, an If block. If the
condition specified in the If Statement is true, the lines inside the If block are executed.
The If block can also contain an Else or several ElseIf actions.
Note
This is different from the If Statement action that is in MSI Script in a Windows Installer
installation.
To create an If block
1.
Add an If Statement and complete the dialog box:
If Variable
Select a variable from the first drop-down list, and a comparison method from
the second drop-down list.
Expression True means the expression in the Value field below is evaluated
according to the rules outlined in
variable is ignored and can be left blank. The result is considered true if it
evaluates to a non-zero result.
(The password comparisons are not applicable in this product.)
The Value
Enter the value to be used in the comparison, or an expression if the
comparison is set to Expression True. If you enter variable names, do not
surround them with percent signs (%). If you enter compiler variables, then you
must surround them with percent signs.
2.
Below the If Statement, add one or more actions to perform if the variable has the
specified value.
3.
(Optional) Add an Else or several ElseIf actions. Follow the Else action with one or
more actions to perform if the compiler variable does not have the specified value.
4.
Add an End Statement.
Sample scripts that use this action are Search.wse, WiseUp.wse, and scripts that
manipulate strings and perform calculations. For details on sample scripts, see
ScriptHelp.htm in the Samples subdirectory of this product's installation directory.
Variables and Expressions
WiseScript Actions
on page 33. The
90

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Wisescript editor 8.0

Table of Contents