[英]Show another license page after finish main installation part using NSIS
So, this is my current installer page structure: 因此,这是我当前的安装程序页面结构:
!insertmacro MUI_PAGE_WELCOME
page custom CheckHWSpecs
!insertmacro MUI_PAGE_LICENSE "${SOURCEFOLDER}\CDA_update061702.txt"
!define MUI_DIRECTORYPAGE_VERIFYONLEAVE
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
When user finish installing the main application, I need to install a third-party application. 当用户完成安装主应用程序时,我需要安装第三方应用程序。 Before start to install the 3rd-party app, I need to show another license page and if user agree, it will continue to install the app.
在开始安装第三方应用程序之前,我需要显示另一个许可证页面,如果用户同意,它将继续安装该应用程序。 But, if user disagree, it will cancel the 3rd-party app installation and the installation process is finish.
但是,如果用户不同意,它将取消第三方应用程序的安装,安装过程完成。
Can I do something like this? 我可以做这样的事情吗?
!insertmacro MUI_PAGE_WELCOME
page custom CheckHWSpecs
!insertmacro MUI_PAGE_LICENSE "${SOURCEFOLDER}\CDA_update061702.txt"
!define MUI_DIRECTORYPAGE_VERIFYONLEAVE
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_LICENSE "${SOURCEFOLDER}\license2.txt"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
But if there are two !insertmacro MUI_PAGE_INSTFILES
, how to make sure the 3rd-party installer will run in the second MUI_PAGE_INSTFILES? 但是,如果有两个
!insertmacro MUI_PAGE_INSTFILES
,如何确保第三方安装程序将在第二个MUI_PAGE_INSTFILES中运行?
SectionSetText ${SectionID} ""
). SectionSetText ${SectionID} ""
的代码可以隐藏)。 MUI_PAGE_LICENSE
) MUI_PAGE_LICENSE
) !insertmacro SelectSection ${SectionID}
!insertmacro SelectSection ${SectionID}
检查隐藏部分!insertmacro SelectSection ${SectionID}
MUI_PAGE_INSTFILES
your 3rd-party app will be installed (or not) like the main app. MUI_PAGE_INSTFILES
期间,将像主应用程序一样安装(或不安装)您的第三方应用程序。 !include Sections.nsh
!include WinMessages.nsh
ShowInstDetails show
!include MUI2.nsh
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Examples\example1.nsi"
!insertmacro MUI_PAGE_INSTFILES
!define MUI_LICENSEPAGE_CHECKBOX
!define MUI_LICENSEPAGE_CHECKBOX_TEXT "Blah blah blah app and agree..."
!define MUI_PAGE_CUSTOMFUNCTION_SHOW Lic2Show
!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Examples\example2.nsi"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE English
Section /o "Bonus app" SID_BONUS
DetailPrint "Installing bonus app..."
Sleep 2222
SectionEnd
Section "Main app" SID_MAIN
DetailPrint "Installing main app..."
Sleep 2222
!insertmacro SelectSection ${SID_BONUS}
!insertmacro UnselectSection ${SID_MAIN}
SectionEnd
Function Lic2Show
GetDlgItem $0 $hwndparent 2
SendMessage $0 ${WM_SETTEXT} 0 "STR:$(MUI_BUTTONTEXT_FINISH)"
FunctionEnd
If the user does not install the extra app then you never get to the finish page, the cancel button is just renamed to "Finish". 如果用户未安装额外的应用程序,则您将永远无法进入完成页面,取消按钮仅重命名为“完成”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.