Archive: Conditional standard pages


Conditional standard (built-in) pages
Hello,

In my installer, I've got standard pages, and custom pages called like that:

!insertmacro MUI_PAGE_WELCOME
Page Custom ChoixTypeInstall ChoixTypeInstallLeave " : Choix type installation"
Page Custom ChoixParamsInstall ChoixParamsInstallLeave " : Paramètres d'installation de DOMEVIH"
Page Custom PgInstall PgInstallLeave " : Paramètres d'installation de PostgreSQL"
Page Custom SavePassword SavePasswordLeave " : Connexion au serveur de base de données"
Page Custom ChoixInstallBase ChoixInstallBaseLeave " : Choix installation base"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup
!insertmacro MUI_PAGE_INSTFILES
Page Custom ChoixRep ChoixRepLeave " : Sélection répertoires"
!insertmacro MUI_PAGE_FINISH

I wanted the standard page "!insertmacro MUI_PAGE_DIRECTORY" to be skipped" in certain conditions coming from my custom pages...

How can I do ?


call abort in the pre callback function to skip a page, read the MUI docs to find the name of the define to use


Whet do you mean using the terms "the define to use" ?

Thanks a lot


In fact, I want the page !insertmacro MUI_PAGE_DIRECTORY not being displayed at each time...

And I didn't find anything on the doc...


If you tried to RTFM, you would find MUI_PAGE_CUSTOMFUNCTION_PRE

so:
function maybeAbort
;maybe call abort here
functionEnd

...
page custom foo bar
!define MUI_PAGE_CUSTOMFUNCTION_PRE maybeAbort
!insertmacro MUI_PAGE_DIRECTORY


I had found that example but didn't succes in trying it...

I tried like that with your example (I need to skip these three files when the consition is not ok):

!define MUI_PAGE_CUSTOMFUNCTION_PRE maybeAbort
!insertmacro MUI_PAGE_DIRECTORY

!define MUI_PAGE_CUSTOMFUNCTION_PRE maybeAbort
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup

!define MUI_PAGE_CUSTOMFUNCTION_PRE maybeAbort
!insertmacro MUI_PAGE_INSTFILES

Page Custom MyPageFunction ""

function maybeAbort
${If} $Condition == "false"
Abort
${EndIf}
functionEnd


The problem is that when the condition is not OK, my three pages are hidden, but I've got an empty page displayed before my last page (MyPageFunction).

If I'm not using the INST_FILES page, that empty page is not displayed and I've got directly my last page :

!define MUI_PAGE_CUSTOMFUNCTION_PRE maybeAbort
!insertmacro MUI_PAGE_DIRECTORY

!define MUI_PAGE_CUSTOMFUNCTION_PRE maybeAbort
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup

Page Custom MyPageFunction ""



Maybe the INST_FILES page has a different behaviour than others... ?

Thanks a lot for your help !!!


What do you mean by an empty page exactly? Are you not creating a page with nsDialogs or InstallOptions in it yet?

Stu


sylvinhio, I think the INSTFILES page might act differently. I think you probably would not want to skip it because that page is the page that executes the Sections in your script and normally does the installation.

Don


Hi,

Thanks for your answers.
Effectively, I want to skip the INSTFILES page too, because in one case in my setup, I needn't to copy files, and treatments are done in previous pages (upadte config files, install framework, ...)

So I don't want the INSTFILES page to be displayed.
And my problem, as I told you previously, is that when trying to skip the INSTFILES, I've got an empty page displayed, with only PREV, NEXT and CANCEL buttons displayed.

Thanks for helping me


Hello,

Is there any soluce to skip that empty page ?

Thanks


i'm also seeing this behaviour. Anyone got an Idea how to solve it?

I tried to use Abort in MUI_PAGE_CUSTOMFUNCTION_SHOW instead of PRE but it didn't work (kinda expected).

Actually i don't want to skip the page completely but change the (sub)title labels if a condition is met(a variable tells if the installer is in 'install' or 'upgrade' mode). So i thought using 2 Versions of the page but showing only one would do the trick (this works for the finish page):


!define MUI_PAGE_CUSTOMFUNCTION_PRE skipIfUpgrade
!define MUI_INSTFILESPAGE_FINISHHEADER_TEXT "Installation done"
!insertmacro MUI_PAGE_INSTFILES
!define MUI_PAGE_CUSTOMFUNCTION_PRE showIfUpgrade
!define MUI_INSTFILESPAGE_FINISHHEADER_TEXT "Upgrade done"
!insertmacro MUI_PAGE_INSTFILES


but for instfiles it creates an additional empty page that requires a 'next' cklick to close it.

using conditional defines in the pre funtion of a single instfiles page didn't work for me either :/