snw
16th May 2006 05:06 UTC
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...
Red Wine
16th May 2006 06:32 UTC
All about MUI is in MUI documentation. ${NSISDIR}\Docs\Modern UI
Jnuw
16th May 2006 20:26 UTC
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
snw
16th May 2006 21:34 UTC
Thanks Jnuw - that's exactly what I needed. Much appreciated.
Jnuw
16th May 2006 22:19 UTC
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
Sadeesh
17th July 2009 15:42 UTC
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