Archive: Skip page


Skip page
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


Yes, if you want to stiop the page from showing up simply call the abort command in the pages show function.

Vytautas


Or start the uninstaller from the configuration program with a parameter (/quickuninstall or something).

Then uset the GetParameters function:

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

(from NSIS manual, appendix B.3)

And include something like this in your NSI: (psuedo-code)
  StrCmp $param1 "/quickuninstall" +2 +1
!insertmacro MUI_UNPAGE_WELCOME
at the place you have defined that pages.

or something like that ;)

Originally posted by Devion
And include something like this in your NSI: (psuedo-code)
  StrCmp $param1 "/quickuninstall" +2 +1
!insertmacro MUI_UNPAGE_WELCOME
at the place you have defined that pages.
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 ;)

To skip a page, Abort should be called in the pre function of the page.


Originally posted by Vytautas
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 ;)
Yup... just figured that out to... :( Thanks for the reminder.. ;)

Ok... Here it is:
  !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfCalledFromProgam
!insertmacro MUI_PAGE_WELCOME


and

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 :D ...

I'll try it as soon as my config. app returns the correct exit codes (probably tomorrow).

Thanks
:up: