Reputation: 165
I want to add a checkbox to the finish page of installer. I have already two checkboxes on finishpage, one for showing readme file and other for opening another link. Now I want to add third checkbox for opening home page of my application.
I am following the steps given in this question as this is the exact thing which I want to achieve Customizing an exsisting NSIS MUI2 page
but the third checkbox is not appearing on finishpage. I am using MUI2.
Here is my code
!include "MUI2.nsh"
var newCheckBox
Function showNewCheckbox
${NSD_CreateCheckbox} 50u 60u 100% 10u "&Launch Google"
Pop $newCheckBox
FunctionEnd
Function launchNewLink
${NSD_GetState} $newCheckBox $0
${If} $0 <> 0
ExecShell "open" "http://google.com"
${EndIf}
FunctionEnd
Function LaunchLink
ExecShell "open" "http://yahoo.com"
FunctionEnd
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_NOTCHECKED
!define MUI_FINISHPAGE_RUN_TEXT "Open yahoo"
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink"
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
!define MUI_FINISHPAGE_SHOWREADME "${README_FILE}"
!define MUI_PAGE_CUSTOMFUNCTION_SHOW showNewCheckbox
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE launchNewLink
!insertmacro MUI_PAGE_FINISH
Am I missing something??
Upvotes: 1
Views: 6252
Reputation: 101764
If $newCheckBox
is a number != 0 it means the control was created, maybe its just behind the image on the left? Try 120u 175u as the first two numbers.
If you don't need a checkbox you can just use the link:
!define MUI_FINISHPAGE_LINK "My website"
!define MUI_FINISHPAGE_LINK_LOCATION "http://example.com"
!insertmacro MUI_PAGE_FINISH
Upvotes: 1