changeset 915:715d41aac9c8

(Issue85) Really move start menu entry to user context
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 20 Aug 2014 17:23:11 +0200
parents dcb6ed6ad594
children 1cc9faa572fd
files packaging/trustbridge.nsi
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/packaging/trustbridge.nsi	Wed Aug 20 16:52:44 2014 +0200
+++ b/packaging/trustbridge.nsi	Wed Aug 20 17:23:11 2014 +0200
@@ -80,7 +80,7 @@
 !define MUI_FINISHPAGE_NOAUTOCLOSE
 !define MUI_UNFINISHPAGE_NOAUTOCLOSE
 
-!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
+!define MUI_STARTMENUPAGE_REGISTRY_ROOT "SHCTX"
 !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\${productname_short}"
 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
 
@@ -233,6 +233,8 @@
   WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" \
                  "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
 
+  ; Below this is HKCU only!
+  SetShellVarContext current
   !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
 
   ;Create shortcuts
@@ -257,8 +259,7 @@
 
   !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
 
-  Delete "$SMPROGRAMS\$StartMenuFolder\${productname}.lnk"
-  RMDir "$SMPROGRAMS\$StartMenuFolder"
+  DeleteRegValue SHCTX "Software\${productname_short}" "Start Menu Folder"
 
   DeleteRegKey /ifempty SHCTX "Software\${productname_short}"
 
@@ -270,5 +271,12 @@
 
 ; Remove uninstaller
   DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}"
+
+  ; Below this is HKCU only!
+  SetShellVarContext current
+
+  Delete "$SMPROGRAMS\$StartMenuFolder\${productname}.lnk"
+  RMDir "$SMPROGRAMS\$StartMenuFolder"
+
 SectionEnd
 !endif

http://wald.intevation.org/projects/trustbridge/