help reading field values on ModernUI
Hello,
I've been struggling with reading the values from some fields i have on a custom dialog using the Modern UI.
Here is the ini content (Tester.ini):
[Settings]
NumFields=1
[Field 1]
Type=CheckBox
Left=15
Right=-12
Top=3
Bottom=18
Text=Enabled Blah
Here are some script snippets that deal with this dialog:
;include custom page
Page Custom ShowDlg LeaveDlg
;initialization
Var DLG_INI
Function .onInit
InitPluginsDir
GetTempFileName $DLG_INI $PLUGINSDIR
File /oname=$DLG_INI "Tester.ini"
FunctionEnd
Function ShowDlg
InstallOptions::initDialog /NOUNLOAD "$BMS_DLG_INI"
InstallOptions::show
FunctionEnd
Function LeaveDlg
!insertmacro MUI_INSTALLOPTIONS_READ $0 "Tester.ini" "Field 1" "State"
MessageBox MB_OK "Value: $0"
FunctionEnd
As you can see this is a very simple example. Im using the MUI_INSTALLOPTIONS_READ macro but it never pulls the value in. MessageBox never displays a value. From what i've read, this script seems correct. Is there something im missing? or is there an alternative way of reading the values from the fields.
Thanks very much for the help. :)