tags:

views:

49

answers:

1

In my NSIS script, the MUI_STARTMENU_GETFOLDER macro is not working as expected - instead of giving me the folder that the user actually entered, it gives me the default that I set earlier. Near the beginning of my script I have:

Var StartMenuFolder ; Define variable to hold start menu folder
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "${PRODUCT_PUBLISHER}\${PRODUCT_NAME}" ; Set default start menu folder
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder

I can access $StartMenuFolder in installer (but NOT uninstaller) Sections by use of !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder. In uninstaller sections and macros, instead of returning the actual start menu folder, it returns the default folder I specified above.

A: 

The MUI_STARTMENU_GETFOLDER macro assumes that you used the MUI_STARTMENUPAGE_REGISTRY_* defines and the MUI_STARTMENU_WRITE_* macros during install (All MUI_STARTMENU_GETFOLDER does is read the registry entry written by the installer (The entry is written in MUI_STARTMENU_WRITE_END if the MUI_STARTMENUPAGE_REGISTRY_* defines are set correctly))

Anders