Navigation:  Click-Script Guide > Expressions >

Logical Expressions

Previous pageReturn to chapter overviewNext page

Logic expressions are used in almost every items of your setup project. You can define conditions to install your files, to do that you must write a logical expression. Also, there are many click-script actions that use logic expressions.

 

 

Comparison Operators

 

exp1 = exp2

Results true if the expressions are equal.

exp1 != exp2

Results true if the expressions are different.

exp1 > exp2

Results true if the expression 1 is greater than the expression 2.

exp1 < exp2

Results true if the expression 1 is less than the expression 2.

exp1 >= exp2

Results true if the expression 1 is greater than the expression 2, or the expressions are equal.

exp1 >= exp2

Results true if the expression 1 is less than the expression 2, or the expressions are equal.

 

 

Logical Operators

 

exp1 && exp2

Results true if the expression 1 and expression 2 are true.

exp1 || exp2

Results true if the expression 1 is true or expression 2 is true.

!exp1

Results true if the expression 1 is false.

 

 

Expressions

 

VisualSetup supports two types of expression for comparison. You can compare either string expressions or numeric expressions.

String expressions must to be defined in quotes:

 

"my string %Var1%" = "%Var2%"

"%Array[%i% + 1]%" = "Europe"

 

Numeric expressions are defined without quotes:

 

%Indexes[%i%]% > 25

(35 * %j%) - 5 != 30 + %k%

 

For further information on string and numeric expressions, read:

String Expressions

Numeric Expressions

 

To define complex logical expressions you can use the logical operators. See some examples below:

 

("%City[%i%]" != "Madrid") && ("%City[%i%]" != "Barcelona")

((%i% = 1) || (%j% = 1)) && (%k% = 1) && ("%City[%i% + %j%]%" = "London")