xbarns
15th July 2008 11:21 UTC
Mui2 - Conditional Run on Finish Page
Hi all,
i created an installer that should offer the user to start a program depending on what sections were selected earlier.
Now i (seem to) understand that with mui2 i have to use nsDialogs to modify (hide) the Run on the Finish Page.
So i think i have to add a
MUI_PAGE_CUSTOMFUNCTION_SHOW FinishFunction
in order to modify the behaviour, my problem is i do not understand how i now get a hand on the Checkbox to hide it.
Looking into the Finish.nsh i find that the checkbox can be referenced by $mui.Finishpage.Run , can i now use that to hide the control? How would i do that?
Thanks for the help :)
LoRd_MuldeR
15th July 2008 11:26 UTC
Why not do it like that?
; page settings
...
!define MUI_FINISHPAGE_RUN ; <- NO PARAMETER HERE
!define MUI_FINISHPAGE_RUN_FUNCTION MyRunFunction ; <- SET RUN FUNCTION
...
;page macros
...
!insertmacro MUI_PAGE_FINISH
...
Function MyRunFunction
; Decide which application to run here!
; Won't be called if "Run" checkbox is unchecked ;-)
Function
xbarns
15th July 2008 11:32 UTC
Hmm i want to completely hide the Checkbox on the FinishPage if a certain component is not installed. With your example i still get a checkbox with no text.
LoRd_MuldeR
15th July 2008 11:35 UTC
Uhm, to *hide* the checkbox you must use a custom show_function, I guess...
Maybe this way:
!define MUI_PAGE_CUSTOMFUNCTION_SHOW FinishFunction
!insertmacro MUI_PAGE_FINISH
Function FinishFunction
ShowWindow $mui.Finishpage.Run ${SW_HIDE}
FunctionEnd
Assuming $mui.Finishpage.Run already contains handle to the checkbox.
Otherwise you'll have to mess around with GetDlgItem first...
EDIT: Make sure MUI_PAGE_CUSTOMFUNCTION_SHOW is defined right before the MUI_PAGE_FINISH macro, do *not* put any other page macro in between!
xbarns
15th July 2008 13:30 UTC
That works like a charm, thanks a lot. :up:
zanz
24th July 2008 23:13 UTC
I want to modify the text on the Finish page (MUI_PAGE_FINISH) to a customer text. Any hint will be helpful on how to do that. Thanks!
LoRd_MuldeR
24th July 2008 23:27 UTC
Put this *before* the language macros:
!deifne MUI_TEXT_FINISH_REBOOTNOW "Reboot now"
!deifne MUI_TEXT_FINISH_REBOOTLATER "I want to manually reboot later"
!deifne MUI_TEXT_FINISH_RUN "&Run $(^NameDA)"
!deifne MUI_TEXT_FINISH_SHOWREADME "&Show Readme"
!deifne MUI_BUTTONTEXT_FINISH "&Finish"
zanz
25th July 2008 02:05 UTC
Thanks so much, it worked!