How can I add a checkbox on finish page of nsis installer window?
I want to add a checkbox on finish page of nsis installer window. If the user check that checkbox then another .exe
should start.
How can I add a checkbox on finish page of nsis installer window?
I want to add a checkbox on finish page of nsis installer window. If the user check that checkbox then another .exe
should start.
NSIS already supports this: MUI_FINISHPAGE_RUN.
You can even force MUI_FINISHPAGE_SHOWREADME to also look and do whatever you want...
!include nsDialogs.nsh
!include LogicLib.nsh
Name nsDialogs
OutFile nsDialogs.exe
XPStyle on
Var Dialog
Var Checkbox
Page custom nsDialogsPage
Page license
Page instfiles
Function nsDialogsPage
nsDialogs::Create 1018
Pop $Dialog
${If} $Dialog == error
Abort
${EndIf}
${NSD_CreateCheckbox} 0 30u 100% 10u "&Something"
Pop $Checkbox
${If} $Checkbox_State == ${BST_CHECKED}
${NSD_Check} $Checkbox
${EndIf}
# alternative for the above ${If}:
#${NSD_SetState} $Checkbox_State
nsDialogs::Show
FunctionEnd
Section
DetailPrint "hello world"
SectionEnd