nsis_noesis
3rd August 2006 10:09 UTC
Problem with MUI and checkbox notifying
I modifief the Modern UI InstallOptions.nsi example a bit.
Now Custom Page C has a dirrequest.
Both the dirrequest and the label are dependent of the checkbox. This means they should become disabled/enabled when the checkbox is toggled.
I tried to do this by adding the ValidatePageC Function.
However this does not seem to work. Should I maybe refresh the custom page after writing the values to the ini file?
Thanks already
nsis_noesis
3rd August 2006 10:13 UTC
Here is the source
Afrow UK
3rd August 2006 11:55 UTC
See Contrib\InstallOptions\testnotify.nsi
-Stu
nsis_noesis
3rd August 2006 12:08 UTC
The only difference between my script and the testnotity.nsi seems to be this piece of code which I now included;
ReadINIStr $4 "ioC.ini" "Field 1" "HWND"
EnableWindow $4 $1
ReadINIStr $4 "ioC.ini" "Field 1" "HWND2"
EnableWindow $4 $1
ReadINIStr $4 "ioC.ini" "Field 3" "HWND"
EnableWindow $4 $1
ReadINIStr $4 "ioC.ini" "Field 3" "HWND2"
EnableWindow $4 $1
But it still doesn't work,
should I maybe do something special because I use MUI?
New code is attached
Afrow UK
3rd August 2006 12:17 UTC
I don't think you can use variables for the EnableWindow state parameter. Try moving them to under your ${If} structure with constants 0 and 1 instead of $1.
-Stu
nsis_noesis
3rd August 2006 12:24 UTC
Tried this,
but still no results.
The Glimmerman
3rd August 2006 13:19 UTC
You should think something like this.
I think.
FindWindow $R1 "#32770" "" $HWNDPARENT
GetDlgItem $1 $R1 1208
EnableWindow $1 1 0
nsis_noesis
3rd August 2006 13:26 UTC
In the testnotity.nsi none of this is used,
I was wondering wether this has anything to do with the fact I use MUI and the testnotify.nsi doesn't.
Does someone maybe notice any difference between testnotify.nsi and my example?
Afrow UK
3rd August 2006 14:01 UTC
Function ValidatePageC
!insertmacro MUI_INSTALLOPTIONS_READ $0 "ioC.ini" "Settings" "State"
${If} $0 == 2
;Read checkbox state
!insertmacro MUI_INSTALLOPTIONS_READ $1 "ioC.ini" "Field 2" "State"
;Enable/Disable DirRequest
!insertmacro MUI_INSTALLOPTIONS_READ $0 "ioC.ini" "Field 3" "HWND"
EnableWindow $0 $1
!insertmacro MUI_INSTALLOPTIONS_READ $0 "ioC.ini" "Field 3" "HWND2"
EnableWindow $0 $1
Abort
${EndIf}
FunctionEnd
Problems:
You weren't checking if NOTIFY was sent.
You were using ReadINIStr instead of MUI_INSTALLOPTIONS_READ.
-Stu
nsis_noesis
3rd August 2006 16:02 UTC
This was the problem,
now it works.
Thanks a lot!