disable next button in a custom page
I am having a weird problem. I can not seem to be able to disable the install button in the following script. Just to make sure I am doing everything right I played with disabling the Cancel button and it worked! But I have no idea why the Install button is stubborn or is it me being stupid?
The script creates a simple license custom page and I want to disable the Install button until the I Agree Radio button is selected otherwise it needs to stay disabled.
***93;
=10
>NumFields=3
>***91;Field 1***93;
>Type=Text
Left
Right=-10
Top=10
Bottom=110
State=blabla
Flags=MULTILINE|VSCROLL|READONLY
>***91;Field 2***93;
>Type=RadioButton
Text=I AGREE
Flags=NOTIFY
State=0
Left=10
Right=110
Top=120
Bottom=128
>***91;Field 3***93;
>Type=RadioButton
Text=I DO NOT AGREE
Flags=NOTIFY
State=1
Left=10
Right=110
Top=131
Bottom=139
>
"LicensePage.ini"
::show
>!include "MUI.nsh"
>!include "Sections.nsh"
>!include WinMessages.nsh
Page custom License LicenseLeave ""
>!insertmacro MUI_PAGE_INSTFILES
OutFile "test.exe"
>Section "dummy"
>SectionEnd
>Function .onInit
!insertmacro MUI_INSTALLOPTIONS_EXTRACT ${FILE_INI}
>FunctionEnd
>Function License
!insertmacro MUI_HEADER_TEXT "License the product" "Please read the license carefully."
InstallOptions::initDialog /NOUNLOAD "$PLUGINSDIR\${FILE_INI}"
GetDlgItem $1 $HWNDPARENT 1
EnableWindow$1 0
InstallOptions
FunctionEnd
>Function LicenseLeave
ReadINIStr$0 "$PLUGINSDIR\${FILE_INI}" "Settings" "State"
IntCmp $0 0 validate
IntCmp$0 2 I_AGREE
IntCmp$0 3 I_DO_NOT_AGREE
Abort
I_DO_NOT_AGREE:
GetDlgItem $1 $HWNDPARENT 1
EnableWindow$1 0
GetDlgItem$1 $HWNDPARENT 2
EnableWindow$1 0
Abort
I_AGREE:
GetDlgItem $1 $HWNDPARENT 1
EnableWindow$1 1
GetDlgItem$1 $HWNDPARENT 2
EnableWindow$1 1
Abort
validate:
>FunctionEnd
>