if-then-else Structure
InstallShield 2022 ยป InstallScript Language Reference
An if statement can also specify one or more statements to be executed if the condition is false. This option is indicated with the keyword else, as shown below:
if (condition) then
// statements to be executed if condition is true
else
// statements to be executed if condition is false
endif;
In the example below, if szStringA equals "exit," the test evaluates to TRUE (1), and the AskYesNo function is called. If szStringA is not equal to "exit," the result is FALSE (0), and the MessageBox function is called following the else statement.
if szStringA = "exit" then
AskYesNo ("Are you sure you want to exit?", NO );
else
MessageBox ("Please wait... ", INFORMATION );
endif;
See Also