Can't get Notify of control to work with MUI
I'm trying to disable/enable a text field when a radio button is selected, as part of a ModernUI Installer with custom page.
The page:
[Settings]
NumFields=4
[Field 1]
Type=Label
Text=Instance
Left=10
Right=38
Top=9
Bottom=17
[Field 2]
Type=RadioButton
Text=Default
Flags=GROUP|NOTIFY
State=1
Left=50
Right=125
Top=9
Bottom=19
[Field 3]
Type=RadioButton
Text=Named Instance
Flags=NOTIFY
State=0
Left=50
Right=125
Top=22
Bottom=32
[Field 4]
Type=Text
MaxLen=20
Flags=DISABLED
Left=128
Right=251
Top=20
Bottom=33
The NSI file (selected parts):
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; Components page
!insertmacro MUI_PAGE_COMPONENTS
Page custom InstancePage InstancePageLeave
(...)
Function .onInit
;Extract InstallOptions INI files
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "Instance.ini"
FunctionEnd
LangString TEXT_IO_TITLE ${LANG_ENGLISH} "Application Instance"
LangString TEXT_IO_SUBTITLE ${LANG_ENGLISH} "Select an application instance to install or upgrade."
Function InstancePage
!insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "Instance.ini"
FunctionEnd
Function InstancePageLeave
; At this point the user has either pressed Next or one of our custom buttons
; We find out which by reading from the INI file
!insertmacro MUI_INSTALLOPTIONS_READ $0 "Instance.ini" "Settings" "State"
StrCmp $0 2 defaultinstance ; "default instance name"?
StrCmp $0 3 namedinstance ; "non-default instance name"?
Abort ; Return to the page
defaultinstance:
; Make the FileRequest field depend on the first checkbox
!insertmacro MUI_INSTALLOPTIONS_WRITE "Instance.ini" "Field 4" "Flags" "GROUP|DISABLED"
Abort ; Return to the page
namedinstance:
; Make the FileRequest field depend on the first checkbox
!insertmacro MUI_INSTALLOPTIONS_WRITE "Instance.ini" "Field 4" "Flags" "GROUP"
!insertmacro MUI_INSTALLOPTIONS_WRITE "Instance.ini" "Field 4" "State" "Default"
Abort ; Return to the page
FunctionEnd
The !insertmacro after the two labels defaultinstance and namedinstance just don't seem to work. Field 4 remains disabled no matter what...
Thanks for any help