简体   繁体   English

自定义NSIS安装程序的完成页面

[英]Customizing the finish page of NSIS installer

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 我正在按照此问题中给出的步骤进行操作,因为这正是我要实现的确切功能。 自定义现有的NSIS MUI2页面

but the third checkbox is not appearing on finishpage. 但是第三个复选框没有出现在完成页面上。 I am using MUI2. 我正在使用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?? 我错过了什么吗?

If $newCheckBox is a number != 0 it means the control was created, maybe its just behind the image on the left? 如果$newCheckBox是一个数字!= 0,则意味着控件已创建,也许它就在左侧图像的后面? Try 120u 175u as the first two numbers. 尝试将120u 175u作为前两个数字。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM