thek
18th June 2007 16:24 UTC
hide & disable RUN Checkbox in the finish Page of MUI
Hello
I'd like to disable (hide & uncheck) the Run checkbox in the finishpage of a MUI installer during runtime.
can somebody tell me what im doing wrong?
the following code doesn't do a thing
The GetdlgItem always return '0':igor:
Somebody have some hints what I'm doing wrong?
!define MUI_PAGE_CUSTOMFUNCTION_SHOW Show_PageFinish_custom
!insertmacro MUI_PAGE_FINISH
Function Show_PageFinish_custom
GetDlgItem $R9 $MUI_HWND 1203 ; run checkbox, see MUI_FINISHPAGE_RUN_TEXT macro
ShowWindow $R9 ${SW_HIDE}
MessageBox MB_OK $R9
# MessageBox MB_OK $MUI_HWND
FunctionEnd
Afrow UK
18th June 2007 17:05 UTC
Why? Why not just not use MUI_FINISHPAGE_RUN?
Instead execute your file in the page's leave function.
Stu
thek
19th June 2007 08:33 UTC
I have the same installer vor Admin and non Admin
If a admin installs he can choose to run the helper programm at the end
If a non admin installs, he must not run the helper programm...
DrDan
19th June 2007 09:28 UTC
How about disable?
I had a similar thing where I needed to disable the check box on the final page rather than hide it.
I have some variable, which I called $MYVAR in this example here. This is set earlier on in the installer depending on a certain condition. You the define the function to be called before the final page is displayed:
!define MUI_PAGE_CUSTOMFUNCTION_PRE "FinalPagePre"
This function sets the Flag of Field 4 (which should be the first check box on the final page if I recall correctly),
Function FinalPagePre
${If} $MYVAR == "true"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Flags" "DISABLED"
${EndIf}
FunctionEnd
There are more details in "NSIS\Docs\Modern UI\Readme.html"
Afrow UK
19th June 2007 09:59 UTC
Your code to hide the check box should work if you have the control id correct. It is 1200 + field number - 1.
If you get to the finish page then look at %TEMP%\ns###.tmp\ioSpecial.ini you can find out which field is the check box (it's an InstallOptions initialisation file).
Stu
thek
19th June 2007 13:47 UTC
thanks !
Joost Verburg
21st June 2007 21:04 UTC
It's easier to read the HWND field, see the InstallOptions readme.