I have a variable, an integer, it has 3 possible values, "-1", "0" and "1".
In the function, .onInit I set it to -1.
I check for 2 different radio buttons to be selected and set it to 0 or 1 depending on which was selected.
I want to be sure I catch all possible things, I hate un-expected errors. So I am attempting to make sure that it isn't selected at all. This works great !!!
HOWEVER if nothing is selected (neither radio button) and I click the cancel aka close button while on this page, I get stuck in a stupid loop. It doesn't close the app, it "Please select an option." and then doesn't close, it calls Reset.
How do I get around this????
PLEASE someone help, I've been banging my head against this for 6 hours. (though I made allot of progress)
Function PAGE_ioInstallType ;FunctionName defined with Page command
IntOp $install_type 0 - 1
Reset:
!insertmacro MUI_HEADER_TEXT "Install Type" "Please select one of the folowing before continuing."
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "ioInstallType.ini"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioInstallType.ini" "Field 1" "Text" "Default (Curent User)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioInstallType.ini" "Field 2" "Text" "Advanced (--nohomedir)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioInstallType.ini" "Field 3" "Text" "This is the standard Jailbreak installation."
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioInstallType.ini" "Field 4" "Text" "For users that have specified '--nohomedir' for their game. Only recommended for experienced users."
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioInstallType.ini" "Field 5" "Text" "Choose the type of installation you prefer, then click Next."
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioInstallType.ini"
;--------------------------------------------------------------------------------------------------------------------
!insertmacro INSTALLOPTIONS_READ $R0 "ioInstallType.ini" "Field 1" "State"
IntCmp $R0 1 do_STANDARD_INSTALL
;--------------------------------------------------------------------------------------------------------------------
!insertmacro INSTALLOPTIONS_READ $R0 "ioInstallType.ini" "Field 2" "State"
IntCmp $R0 1 do_CUSTOM_INSTALL
;--------------------------------------------------------------------------------------------------------------------
IntCmp $install_type -1 StartReset
StartReset:
MessageBox MB_OK|MB_ICONEXCLAMATION "Please select an option."
Goto Reset
do_STANDARD_INSTALL:
IntOp $install_type 0 + 0
Abort
do_CUSTOM_INSTALL:
IntOp $install_type 0 + 1
Abort
FunctionEnd