Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Problem with conditional Installer page (http://forums.winamp.com/showthread.php?t=258402)

PerryRho 27th October 2006 14:52

Problem with conditional Installer page
 
I use a Modern UI installer structure with an entry for a custom page that launches one of my applications at the end of the installation process,
like
...
!insertmacro MUI_PAGE_STARTMENU Application $ICONS_GROUP
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_RUN "$INSTDIR\MySpecialApp.exe"
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES

Now I define 3 InstTypes, and Type 2 is without installing MySpecialApp.
When within the installation process I choose Type 2, I have to make sure that the "Run MySpecialApp now" page is not displayed for this InstType.
I fail repeatedly.
Mostly because "if[InstType2] - then[don't display that thing]" conditions must appear in sections or functions, but the installer page listn is not within a function, but apparently plain body text after the header.
Is it possible to switch an installer page on or off depending on the InstType value?
I didn't see any related thread in the forum. If there is any, and I was just too blind - a link will be my friend.

Thanks in advance,

John.

kichik 27th October 2006 17:30

You've missed the FAQ which contains an entry about skipping pages.

To figure out which installation type was selected, you can use GetCurInstType, but it'd be simpler to check if $INSTDIR\MySpecialApp.exe exists.

PerryRho 1st November 2006 15:31

So I tried ...

but sorry, I couldn't see any useful hint in the FAQ for this problem.
The main thing seems to be that I cannot build a function that is able to switch between the finish pages
MUI_FINISHPAGE_RUN "$INSTDIR\MySpecialApp.exe"
and
MUI_PAGE_FINISH
depending on the value of e.g. GetCurInstType. Either it isn't allowed to call macros containing that AutoCloseWindow parameter from within a function (as MUI_PAGE_FINISH is one of them), or it is impossible to use an if-then-condition outside a function. And I try to make an installer whose pages can be activated or deactivated depending on the InstallType, like
"if InstallType is [a], then call finishpage 1, else call finishpage 2"
I still can't figure out where this "else" has to be placed.
I hope anyone has a straw for me to clutch on.


All times are GMT. The time now is 04:33.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.