Archive: Conditionally skip the directory selection page (MUI)


Conditionally skip the directory selection page (MUI)
Hi,

My installer consists of several Sections, only two of which actually install files to the hard disk. If none of these sections is selected, I would like to skip the directory selection page.

Does anyone have an idea how to do this?

Thanks,
Joost


Use the pre function on the directory page to check the section flags and skip the page if the sections aren't selected? (errm no I can't give you exact code right now, I'm not familiar enough with that code and I'm a little busy :D)...


How is it possible to skip a page anyway?
I know Return will return back to a page on leave, but I didn't know it was possible to skip over a page, or even 2 pages?

-Stu


Calling Abort from the pre function skips the page. If you want to skip 2 pages, call Abort from both's pre function.

To skip the directory page using the MUI use:

!define MUI_CUSTOMFUNCTION_DIRECTORY_PRE myPreDirFunc
# ...

Function myPreDirFunc
StrCmp $0 1 dontSkip
Abort # skip the page
dontSkip:
FunctionEnd

Originally posted by kichik
Calling Abort from the pre function skips the page. If you want to skip 2 pages, call Abort from both's pre function.
It is possible to skip a custom page? custom pages doesn't have a pre function, so I don't know if it can be done with Abort...

And how to force in a custom page to go to the previous page?

Thanks

To skip a custom page just end it's creator function before you call the plug-in that shows the page. This could easily done using Abort from a called function or Return if you're in the function itself. You could also jump to a label at the end of the creator function that skips the plug-in call.

You can't go back. You can call Abort from a page's leave function (available for custom pages too in latest CVS version) to deny the user from moving on to the next page.