[PATCH] (Issue85) Really move start menu entry to user context

Wald Commits scm-commit at wald.intevation.org
Wed Aug 20 17:23:15 CEST 2014


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1408548191 -7200
# Node ID 715d41aac9c895ede1e161843bf33d759f0e1f35
# Parent  dcb6ed6ad5945cb6cd0dd0070ea27d3f55a1ef35
(Issue85) Really move start menu entry to user context

diff -r dcb6ed6ad594 -r 715d41aac9c8 packaging/trustbridge.nsi
--- 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


More information about the Trustbridge-commits mailing list