installer - Show finish page if user click cancel on license page NSIS -
I have two license pages and on the second license page, if the user chooses to not install 3rd party app, then This will be shown End of page So far, I use the MUI_CUSTOMFUNCTION_ABORT user access
to go to the finished page.
But the problem is that when the user clicks the Skip button (this is actually a cancel button and I leave it), this license will be created on the page and the install button will be placed on the next button ( Image 1 -> Image 2 -> Image 3). I know that this happens because I call abort
in onUserAbort
. If I do not call abort
, then the window will close automatically when click Skip user.
Do you have any idea how straight the step is to end the page? (Image 1 -> Image 3, without Image 2)
! Insert MUI_PAGE_WELCOME page custom checkHWSPECJenate METIMIMATE dialog! Insert MUI PAGE_LICENSE "$ {SOURCEFOLDER} \ license1.txt"! Define MUI_DIRECTORYPAGE_VERIFYONLEAVE! Insert MUI_PAGE_DIRECTORY! Insertmacro MUI_PAGE_STARTMENU application $ StartMenuGroup! Insertmacro MUI_PAGE_INSTFILES! Define MUI_LICENSEPAGE_CHECKBOX! MUI_PAGE_CUSTOMFUNCTION_PRE Set Lic2Pre! MUI_PAGE_CUSTOMFUNCTION_SHOW Lic2Show! Insertmacro MUI_PAGE_LICENSE "$ {SOURCEFOLDER} \ license2.txt"! Defined MUI_PAGE_INSTFILES insertmacro! Insertmacro MUI_PAGE_FINISH! Insertmacro MUI_UNPAGE_CONFIRM! Insertmacro MUI_UNPAGE_INSTFILES! Set MUI_CUSTOMFUNCTION_ABORT onUserAbort! Insertmacro MUI_LANGUAGE English
code Lic2Pre:
function Lic2Pre strcpy $ R8 2 FunctionEnd
code Lic2Show:
function Lays 2 show GetDlgItem $ 0 $ hwndparent 2 SendMessage $ 0 $ {WM_SETTEXT} 0 "STR: Skip" SelectSection $ {SEC0013} UnselectSection $ {SEC0000} insertmacro UnselectSection $ {SEC0002} insertmacro Unselektsekshn $ {} Sek0003 Inssertmakro Unselektsekshn $ {} Sek0004 Inssertmakro Unselektsekshn $ {} Sek0005 Inssertmakro Unselektsekshn $ Inssertmakro {Inssertmakro !!!!!! SEC0007} UnselectSection $ {} SEC0010} UnselectSection $ {SEC0011 insertmacro insertmacro UnselectSection $ {SEC0012} FunctionEnd insertmacro
code to the specific page :!
function RelGotoPage IntCmp $ R9 0 0 Move strcmp $ R9 "X" 0 visit strcpy $ R9 "Move 120" take: SendMessage $ HWNDPARENT "0x408" "$ R9" " "FunctionEnd
custom function on user cancel:
function onUserAbort strcmp $ R8 2 0 end Close between strcpy $ R9 2 calls RelGotoPage end: FunctionEnd
! Include section! Nsh! WinMessages Include .nsh ShowInstDetails Show! Define MUI_CUSTOMFUNCTION_ABORT onUserAbort! MUI2.nsh included! Insertmacro MUI_PAGE_WELCOME! Insertmacro MUI_PAGE_LICENSE "$ {NSISDIR} \ example \ example1.nsi"! MUI_PAGE_INSTFILES insertmacro! Define MUI_LICENSEPAGE_CHECKBOX! Defined MUI_LICENSEPAGE_CHECKBOX_TEXT "blah blah blah application and agree ..."! Define MUI_PAGE_CUSTOMFUNCTION_LEAVE Lic2Leave! Insert MUI_PAGE_LICENSE "$ {NSISDIR} \ example \ example2.nsi"! Insertmacro MUI_PAGE_INSTFILES! Insert MUI_PAGE_FINISH! Insert MUI_LANGUAGE English section / o "Bonus app" SID_BONUS extension print "Installing Bonus app ...!" Sleep 2222 sectionindex section "Main app" SID_MAN Extensions "Installing the main app ..." sleep 2 222 InstallBonus function on sectionEnd lic2Show strcpy $ installBonus 1 GetDlgItem $ 0 $ hwndparent 2 SendMessage $ 0 $ {WM_SETTEXT} 0 "STR: & amp; Skip"! UnselectSection $ {SID_MAIN} insertmacro; Already installed, unchecked FunctionEnd function Lic2Leave $ {are} $ installBonus == 1 insertmacro SelectSection $ {SID_BONUS} $ {endif} FunctionEnd function onUserAbort $ {are} $ installBonus == 1 strcpy $ installBonus 0 System: Call ' USER32:: PostMessage (i $ HWNDPARENT, i0x408, I1, I0) '; Delayed 1 page close $ {endif} FunctionEnd
Comments
Post a Comment