InstallAware for Windows Installer Header Image Windows Installer without Rocket Science
InstallAware for Windows Installer
 

Evaluate Expression

This command evaluates complex logical expressions, and stores the result in a variable.

Expression

Enter the expression to evaluate in this field. The expression must have the following syntax:

eval-token <bool-operator> eval-token [<bool-operator> eval-token, ...]

An eval-token is comprised of a token and operator provided in this form: token <operator> token.

A token is either a string literal or a variable. String literals must be enclosed in double quotes. Variables must be enclosed between "$" signs. An example string literal token would be "this is a string". An example variable token would be $EXAMPLE_VAR$.

An operator may be any one of the following: =, <>, <=, <, >=, >. These operators test for equality, inequality, "less than or equal to", "less than", "greater than equal to", and "greater than" relationships between the given tokens. If the relationship holds between the given tokens, the result of the evaluation is TRUE, and FALSE otherwise.

An expression may be compounded using the bool-operator. A bool-operator is either and or or. and evaluates an expression to TRUE if both eval-tokens evaluate to TRUE. or evaluates an expression to TRUE if at least one eval-token evaluates to TRUE.

While operator precedence is not available, you may use bracket signs ( ) to specify priority when evaluating expressions. Otherwise, evaluation proceeds from left to right without any precedence.

An example expression would be: $A$ = "value1" or ($B$ = "value2" and $C$ = "value3"). In this example, A, B, and C are regular script variables. The expression evaluates to TRUE if variable A holds the value value1, or variable B holds the value value2 together with variable C holding the value value3. All three variables must have been defined before the Evaluate Expression command executes to avoid runtime errors.

Variable

Enter the variable to receive the result of the evaluation in this field. If the expression contains a syntax error, this variable receives ERROR. If the expression evaluates to a true condition, this variable receives TRUE. If the expression evaluates to a false condition, this variable receives FALSE. If the expression references an undefined variable, this variable receives ERROR.

 Notes

  • The syntax of this command is identical to the third-party Camelot Eval Plug-In.