Archive: Skip several pages


Skip several pages
I have an installer that is re-configurable, so that if there is a component you didn't install the first time, you may re-open the installer to add that component to the install later.

The components you install, will then not be available in the installer afterwords, but will then turn up in the uninstaller, and vice versa.

All of that works already, so that's not my question.

My question is:

It's a little cumbersome when people re-open the installer, that they have to go through the Welcome page, License page(and check a check box), and Directory page, in order to get to the Components page to install components they didn't install the first time.


So I was wondering if there is a way to look up a registry key, and if it's present, skip all those pages and go directly to the components page?

I have found some pseudo script examples here on how to skip one page, but I'd like to skip three.

I'm not too good at understanding pseudo script and getting something working from it either.

Thanks in advance.


In the page Pre function you need to call Abort. You could call Abort in all 3 page's Pre functions if a condition is true (e.g. $R0 == 1)

-Stu


Yes!

It works! Wohoo! :)


If anyone else reads this and wonders how I did it, I'll post an example below:

First, the function:


Function SkipPages
ReadRegStr $1 HKLM \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\AppName" \
"UninstallString"
StrCmp $1 "" done
Abort
done:
FunctionEnd


(the registry key is probably different in your case, I just changed mine slightly for this example)



Then you simply put the PRE function define above each of the page macros you want to skip, like this:


!define MUI_PAGE_CUSTOMFUNCTION_PRE SkipPages
!insertmacro MUI_PAGE_WELCOME
!define MUI_PAGE_CUSTOMFUNCTION_PRE SkipPages
!insertmacro MUI_PAGE_LICENSE "ReadMe.rtf"
!define MUI_PAGE_CUSTOMFUNCTION_PRE SkipPages
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH


It works here.

Thanks for the help, both here and in other threads. :)