Archive: turn off modern Select-StartMenu-Folder UI


turn off modern Select-StartMenu-Folder UI
  Hi, I try to setup a (Modern UI) nsi script for my tool :), and I have a problem...

The user has the option (a section) to enable/disable startmenu icon creation, but I dont know how I can disable the MUI_STARTMENUPAGE, once I defined it...

What I do now is: at the beginning of the Script I !define MUI_STARTMENUPAGE, but now I dont know how to turn it off if the startmenu-icnos section was disabled, meaning dont create icons, so no need for asking for the folder...

does anybody understand what I wanna do, and has an idea?

(I hope is no dupe post, i really search a while...)



define MUI_CUSTOMFUNCTION_STARTMENU_PRE Abort


>Function Abort
SectionGetFlags${SectionDefineName} $R0
StrCmp $R0 1+2 0
Abort
FunctionEnd
>
Change the "SectionDefineName" to the component name (like SecStartMenuIcons)

You can use the same function to other NSIS pages (welcome, licence ...) in pre function (i.e. !define MUI_CUSTOMFUNCTION_DIRECTORY_PRE Abort), to make this page only appears when the Start Menu Icons Section are selected in components page.

The one problem is: the Install Button, when the Start Menu Page is before the InstFiles Page, if you skip, the Install Button in the page that come before the Start Menu Page show "Next >".

You forgot IntOp deguix:

!define MUI_CUSTOMFUNCTION_STARTMENU_PRE Abort
!include Sections.nsh

Function Abort
SectionGetFlags ${SectionDefineName} $R0
IntOp $R0 $R0 & ${SF_SELECTED}
StrCmp $R0 ${SF_SELECTED} +2 0
Abort
FunctionEnd


Also make sure you put this function after the definition of the section so it can recognize the define.

BTW, there is a check box at the bottom of the start menu for disabling the creation of start menu items, why is that not enough?

Because he put Start Menu Icons section in Components Page to create the icons, so for what to show the page? He choosed this way to make his installator.


Putting related content on multiple pages is confusing for the user.