2

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.

Ryan Gates
  • 4,501
  • 6
  • 50
  • 90
vijil
  • 21
  • 1
  • 2

2 Answers2

3

NSIS already supports this: MUI_FINISHPAGE_RUN.

You can even force MUI_FINISHPAGE_SHOWREADME to also look and do whatever you want...

Community
  • 1
  • 1
Anders
  • 97,548
  • 12
  • 110
  • 164
  • could u tell the step by step for adding the checkbox on finish page of nsis installer window ? – vijil Sep 07 '12 at 04:42
  • @PauloCarvalho: What are you talking about? I linked to the MUI documentation. Click the first link in my answer, click "Expand all" and search for "_RUN". – Anders Jun 22 '14 at 00:16
-1
!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
Roney Michael
  • 3,964
  • 5
  • 30
  • 45
palkesh
  • 11
  • 1