Archive: Problem with MUI and checkbox notifying


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


Here is the source


See Contrib\InstallOptions\testnotify.nsi

-Stu


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


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


Tried this,
but still no results.


You should think something like this.
I think.

FindWindow $R1 "#32770" "" $HWNDPARENT
GetDlgItem $1 $R1 1208
EnableWindow $1 1 0


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?



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

This was the problem,
now it works.
Thanks a lot!