所以,这是我当前的安装程序页面结构:
!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
当用户完成主应用程序的安装时,我需要安装第三方应用程序。在开始安装第三方应用程序之前,我需要显示另一个许可证页面,如果用户同意,它将继续安装该应用程序。但是,如果用户不同意,它将取消第三方应用程序安装,安装过程完成。
我可以这样做吗?
!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
但如果有两个!insertmacro MUI_PAGE_INSTFILES
,如何确保第三方安装程序将在第二个MUI_PAGE_INSTFILES中运行?
答案 0 :(得分:0)
SectionSetText ${SectionID} ""
的代码,则可以隐藏它。)MUI_PAGE_LICENSE
)!insertmacro SelectSection ${SectionID}
MUI_PAGE_INSTFILES
期间,您的第三方应用程序将像主应用程序一样安装(或不安装)。答案 1 :(得分:0)
!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
如果用户没有安装额外的应用程序,那么你永远不会进入完成页面,取消按钮只是重命名为"完成"。