[英]Show another license page after finish main installation part using NSIS
因此,這是我當前的安裝程序頁面結構:
!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中運行?
SectionSetText ${SectionID} ""
的代碼可以隱藏)。 MUI_PAGE_LICENSE
) !insertmacro SelectSection ${SectionID}
檢查隱藏部分!insertmacro SelectSection ${SectionID}
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
如果用戶未安裝額外的應用程序,則您將永遠無法進入完成頁面,取消按鈕僅重命名為“完成”。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.