No announcement yet.

Problem getting start menu folder uninstallation

  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem getting start menu folder uninstallation


    I am working on an updater that overwrite and add some files to my application.

    Because I add some files, I have to rewrite my uninstaller also.
    But I have trouble in getting the start menu folder uninstallation

    This is what I do


    !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
    RMDir /r "$SMPROGRAMS\$StartMenuFolder"

    But I am getting during compilation the following error

    warning: unknow variable/constant "<MUI_STARTMENUPAGE_Application_DEFAULTFOLDER>" detected, ignoring <macro:MUI_STARTMENU_GETFOLDER:20>
    error in macro MUI_STARTMENU_GETFOLDER on macro line 20

    The problem seem that I have not define the variable "Application". But this variable is define in my installer like this

    ;page STARTMENU
    Var StartMenuFolder
    !insertmacro MUI_PAGE_STARTMENU "Application" $StartMenuFolder

    but not in my updater because I don't want to reinstall a Start Menu, just want to get the existing one.

    So,how can I get this value?
    Thanks in advance for your help
    Website :

  • #2
    I have still not find any issue to this problem

    I have found another post that explains that we could write in the registry some value to remember of the startmenufolder (that is choosen during installation)

    I have reported below the code that Brummelchen has given


    ;Remember the Start Menu Folder
    !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\<yoursoft>"

    ;Installer Sections

    ;Create shortcuts
    CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\<yourapp>.lnk" "$INSTDIR\<yourfile>.ext"
    !insertmacro MUI_STARTMENU_WRITE_END

    ;Uninstaller Section

    ;must be the first in this sektion
    ;when you are going to delete the whole key later
    ; DeleteRegKey HKCU "Software\<yoursoft>"

    ;Remove shortcuts
    Push $R0
    ;ReadRegStr $R0 HKCU "Software\<yoursoft>" "StartMenuFolder"
    StrCmp $R0 "" noshortcuts
    RMDir /r "$SMPROGRAMS\$R0"
    Pop $R0


    But here the user have already installed the software, I work on an updater that overwrite some files. So is it to late to refind the startMenuFolder?

    Also I have some trouble to overwrite the uninstaller. Because I have create some new file, I have also to tell the uninstaller to delete these new files.

    So, I have rewrite in my updater an uninstaller section, (the code is quite the same as in my installer but with some additional RMDir)

    Section "Uninstall"
    RMDir /r "$INSTDIR\MyNewFolderAndNewFiles"

    But the uninstaller is not overwrite..

    I can't figure out why

    Can anyone help?

    Thanks in advance
    Website :


    • #3
      Even if you don't use it, you'll have to insert the MUI_PAGE_STARTMENU macro so everything will be properly defined. You can define a pre callback function for it and skip it.

      Another solution would be to dig into the MUI macros, figure out where it writes stuff to the registry and just use that directly.
      NSIS FAQ | NSIS Home Page | Donate $
      "I hear and I forget. I see and I remember. I do and I understand." -- Confucius