Skip to content
⌘ NSIS Forum Archive

Mui2 - Conditional Run on Finish Page

8 posts

xbarns#

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#
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#
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#
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!
zanz#
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#
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"