Skip to content
⌘ NSIS Forum Archive

How do I conditionally invoke InstallOptions dialogs using Modern UI script/macros?

5 posts

humgut#

How do I conditionally invoke InstallOptions dialogs using Modern UI script/macros?

Hi,

I just got the latest CVS snapshot. As an NSIS neophyte, I find the Modern UI macros and example scripts are much improved since 2.0a7. 👍

I want to make the invocation of one or more InstallOptions dialogs conditional on whether a specific optional component has been selected by the user. The sample InstallOptions.nsi script provides a great template for deploying InstallOptions, but I'm not sure what the cleanest approach to conditional invocation would be.

Any assistance greatly appreciated.
Joost Verburg#
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.
Joost Verburg#
You can skip the IO page in the SetPage function. Insert MUI_INSTALLOPTIONS_NEXT where the page should be skipped.

Example:

StrCmp $SOMEVAR somevalue skip
!insertmacro MUI_INSTALLOPTIONS_SHOW 6 "ioC.ini" "" "" ;Next/previous pages are NO IO pages
Goto noskip

skip:
!insertmacro MUI_INSTALLOPTIONS_NEXT

noskip:
pcristip#
Joost can you tell me how I should accomplish this in v2.0b3 ?
I tried your suggestion but it seems that MUI_INSTALLOPTIONS_NEXT is not defined in system.nsh and makensis gives an error.

An complete example of a conditional InstallOptions page would be nice 😁

Regards,
Chris
kichik#
Function SetCustomB
  StrCmp $SOMEVAR somevalue skip
    !insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)"
    !insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioB.ini"
  skip:
FunctionEnd