Archive: Finish page buttons


Finish page buttons
I am building an installer using the Modern UI and I'd like to completely remove the Cancel button (the installer has finished already, it's too late to cancel AFAIAC) and alter the text of the Finish button to read 'Next' instead.

Can anyone suggest how I might achieve either/both of these things? TIA...


All about MUI is in MUI documentation. ${NSISDIR}\Docs\Modern UI


Per ${NSISDIR}\Docs\Modern UI:


Add this !define above your finish page macro...


!define MUI_PAGE_CUSTOMFUNCTION_SHOW "FinishShow"
!insertmacro MUI_PAGE_FINISH


Then add this function:

Function FinishShow
GetDlgItem $0 $HWNDPARENT 3
ShowWindow $0 0 ;Hides the Back Button
GetDlgItem $0 $HWNDPARENT 2
ShowWindow $0 0 ;Hides the Cancel Button
GetDlgItem $0 $HWNDPARENT 1
SendMessage $0 ${WM_SETTEXT} 0 "STR:Next"
FunctionEnd

Thanks Jnuw - that's exactly what I needed. Much appreciated.


You are very welcome. There is a ton of great documentation out there for NSIS, but it is spread between:
- "C:\Program Files\NSIS\Docs\InstallOptions\Readme.html"
- "C:\Program Files\NSIS\Docs\Modern UI\Readme.html"
- "C:\Program Files\NSIS\NSIS.chm"
- Search function within these forums

Hope this helps. -jnuw


But this piece of code doesnt work in uninstaller page.

I was able to hide the cancel button, but cannot hide the back button.

GetDlgItem $0 $HWNDPARENT 3
ShowWindow $0 0 ;Hides the Back Button
GetDlgItem $0 $HWNDPARENT 2
ShowWindow $0 0 ;Hides the Cancel Button