Hello,
We are creating a setup for a rather complex suite of products. In order to configure everything, we created a windows client to perform all the additional configuration tasks. The client is called after the setup program finishes.
When a configuration fails, it performs a rollback, after which uninstall.exe is executed.
Is it possible to skip the welcome page when uninstall is called from the configuration program, and not skip it when executed directly ?
Thanks
Yoeri
Skip page
7 posts
Yes, if you want to stiop the page from showing up simply call the abort command in the pages show function.
Vytautas
Vytautas
Or start the uninstaller from the configuration program with a parameter (/quickuninstall or something).
Then uset the GetParameters function:
And include something like this in your NSI: (psuedo-code)
or something like that 😉
Then uset the GetParameters function:
(from NSIS manual, appendix B.3)Function GetParameters
Push $R0
Push $R1
Push $R2
Push $R3
StrCpy $R2 1
StrLen $R3 $CMDLINE
;Check for quote or space
StrCpy $R0 $CMDLINE $R2
StrCmp $R0 '"' 0 +3
StrCpy $R1 '"'
Goto loop
StrCpy $R1 " "
loop:
IntOp $R2 $R2 + 1
StrCpy $R0 $CMDLINE 1 $R2
StrCmp $R0 $R1 get
StrCmp $R2 $R3 get
Goto loop
get:
IntOp $R2 $R2 + 1
StrCpy $R0 $CMDLINE 1 $R2
StrCmp $R0 " " get
StrCpy $R0 $CMDLINE "" $R2
Pop $R3
Pop $R2
Pop $R1
Exch $R0
FunctionEnd
And include something like this in your NSI: (psuedo-code)
at the place you have defined that pages.StrCmp $param1 "/quickuninstall" +2 +1
!insertmacro MUI_UNPAGE_WELCOME
or something like that 😉
Originally posted by DevionThis won't work as the pages are defined during compile time and StrCmp is a run-time command and should be used in a function/section. You will have to call abort from the show function of that page to skip showing it.
And include something like this in your NSI: (psuedo-code)
at the place you have defined that pages.StrCmp $param1 "/quickuninstall" +2 +1
!insertmacro MUI_UNPAGE_WELCOME
Vytautas 😉
To skip a page, Abort should be called in the pre function of the page.
Originally posted by VytautasYup... just figured that out to... 🙁 Thanks for the reminder.. 😉
This won't work as the pages are defined during compile time and StrCmp is a run-time command and should be used in a function/section. You will have to call abort from the show function of that page to skip showing it.
Vytautas 😉
Ok... Here it is:
and!define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfCalledFromProgam
!insertmacro MUI_PAGE_WELCOME
Function SkipIfCalledFromProgam
... some code that determs if it's called by other program
... use regkeys or fileexists or something
... and put "yes" value in $0
StrCmp $0 "yes" +1 DoNotSipThisPage
Abort
DoNotSipThisPage:
FunctionEnd
Thanks a lot for the replies 😁 ...
I'll try it as soon as my config. app returns the correct exit codes (probably tomorrow).
Thanks
👍
I'll try it as soon as my config. app returns the correct exit codes (probably tomorrow).
Thanks
👍