Archive: check values in if/else


check values in if/else
  Hello,
I have a problem in performing an if/else with two variables. I´m new in this and I don´t how to this.
Here´s my code. I read the values of the two variables $Play and $Install, both are checkboxes. If nothing is selected a message box should appear. If $Play is selected the installer quit and the game will be started. If $Install is selected I will continue with the installer.

!insertmacro MUI_INSTALLOPTIONS_READ $Play "test.ini" "Field 4" "State"

>!insertmacro MUI_INSTALLOPTIONS_READ $Install "test.ini" "Field 5" "State"
>${If} $Play == 0 && $Install == 0
# message box appears
>MessageBox MB_OK "Please select...!"
>${Else} {If} $Play == 1
# start game and quit installer
>Exec "test.exe"
Quit
#${Else}{If}$Install == 1
# go to next page installer?????
${EndIf}
Can you please help me with this if/else. How can I ask for values of two variables, I can´t use "&&". I don´t know how to do. What command can I use to continue with the installer.
Thank you very much.

Try:


${If} $Play == 0
${AndIf} $Install == 0
# message box appears
MessageBox MB_OK "Please select...!"
${ElseIf} $Play == 1
# start game and quit installer
Exec "test.exe"
Quit
${EndIf}

I´ve tried this and it works. Thanks. But I have another question. If the user don´t make a choice the message box appears. Now the user press the ok button and the next page of the installer appears. How can I stay on the first side so that the user can make his choice???


You need to add an abort call right after your message box call.


How can I do an abort call? I´m not familiar enough with this syntax. Could you please help me?


See in blue below:


${If} $Play == 0
${AndIf} $Install == 0
# message box appears
MessageBox MB_OK "Please select...!"
abort
${ElseIf} $Play == 1
# start game and quit installer
Exec "test.exe"
Quit
${EndIf}


This is examplained in the help files, Section 4.5.3:
The leave-function allows you to force the user to stay on the current page using Abort

Thank you very much for your help. Now it works and I can finish.
Kadijsha