PDA

View Full Version : File properties, Conditions, Script condition


pmoncayo
01-24-2006, 07:08 PM
Hello

I need to evaluate two different variables to decide if I install certain file

I usually use this for one variable, strcombobox == "ACAPULCO" but now I have to include another variable so I don't know the correct syntax, I used strcombobox == "ACAPULCO" AND strcombobox =="MANAGER" but it's not working

:huh
thx

drpepper
02-07-2006, 10:40 AM
pmoncayo,

You say you need to check 2 different variables but your example is referencing only 1 variable: strcombobox. i.e.:

"strcombobox == "ACAPULCO" AND strcombobox =="MANAGER"

If you are checking for either value within the same variable the syntax should be:

"if strcombobox == "ACAPULCO" or strcombobox == "MANAGER" then..."

On the other hand, if you are checking 2 separate variables the syntax would be something like this (note that 2 completely different variables are being used):

"if strcombobox1 == "ACAPULCO" and strcombobox2 == "MANAGER" then..."

Lastly, if, by any chance, the variables you're checking are session variables, then you must use the following syntax to expand the session variable values:

"if SessionVar.Expand("%strcombobox%") == "ACAPULCO" or SessionVar.Expand("%strcombobox%") == "MANAGER" then..."

Hope this advice proves helpful...

rv

drpepper
02-07-2006, 01:05 PM
I've reviewed some of your other posts and it appears that you are really interested in the boolean conditional statement used in Conditions/Script Condition section used with a specific archive file to set/check, at run-time, whether or not a file should be installed.

The script condition must be a LUA statement that EVALUATES to a boolean true/false consdition...so....

in the statement you place in this input box, DO NOT include the "if"...in other words do not use a statment like this:

if stcombobox == "ALCAPULCO" or strcombobox == "MANAGER" then...

Instead, simply place a statement that will evaluate to a boolean result:

strcombobox == "ALCAPULCO" or strcombobox == "MANAGER"

Note there is no if...and there is no then either; SUF will evaluate the statement and determine if it is true or false. If true, the file will be installed; if it evaluates to false, the file will not be installed.

I hope this gets closer to the answer you're looking for