diff options
author | Littleboy | 2011-04-28 13:35:35 -0400 |
---|---|---|
committer | Littleboy | 2011-04-28 13:35:35 -0400 |
commit | 95f6290650ece25c959546e375d8b5382053fd8c (patch) | |
tree | f978e03d2c8ba172e78cc396beba758411cf0c0c | |
parent | ef6d9216aa23f82519e01df1c2a99ae785e49196 (diff) | |
download | scummvm-rg350-95f6290650ece25c959546e375d8b5382053fd8c.tar.gz scummvm-rg350-95f6290650ece25c959546e375d8b5382053fd8c.tar.bz2 scummvm-rg350-95f6290650ece25c959546e375d8b5382053fd8c.zip |
DISTS: Update NSIS start menu shortcuts creation/removal
- Create shortcuts in all-users start menu folder
- Properly remove all shortcuts on uninstall
-rw-r--r-- | dists/nsis/scummvm.nsi | 18 | ||||
-rw-r--r-- | dists/nsis/scummvm.nsi.in | 18 |
2 files changed, 26 insertions, 10 deletions
diff --git a/dists/nsis/scummvm.nsi b/dists/nsis/scummvm.nsi index 29a3e7ebfa..2fe08e046f 100644 --- a/dists/nsis/scummvm.nsi +++ b/dists/nsis/scummvm.nsi @@ -237,8 +237,9 @@ Section -post SecMainPost SetOutPath $INSTDIR WriteUninstaller $INSTDIR\uninstall.exe !insertmacro MUI_STARTMENU_WRITE_BEGIN Application + SetShellVarContext all ; Create shortcuts in the all-users folder CreateDirectory "$SMPROGRAMS\$StartMenuGroup" - CreateShortCut "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk" $INSTDIR\$(^Name).exe + CreateShortCut "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk" $INSTDIR\$(^Name).exe "" "$INSTDIR\$(^Name).exe" 0 ; Create shortcut with icon CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Readme.lnk" $INSTDIR\README.txt CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" $INSTDIR\uninstall.exe !insertmacro MUI_STARTMENU_WRITE_END @@ -295,15 +296,22 @@ Section -un.Main SecUninstall SectionEnd Section -un.post SecUninstallPost - DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" + # Remove start menu entries + SetShellVarContext all + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk" + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Readme.lnk" Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" - Delete /REBOOTOK $INSTDIR\uninstall.exe + RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup + + Delete /REBOOTOK $INSTDIR\uninstall.exe + + DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DeleteRegValue HKCU "${REGKEY}" StartMenuGroup DeleteRegValue HKCU "${REGKEY}" InstallPath DeleteRegValue HKCU "${REGKEY}" InstallerLanguage DeleteRegKey /IfEmpty HKCU "${REGKEY}" - RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup - RmDir /REBOOTOK $INSTDIR ; will only remove if empty (pass /r flag for recursive behavior) + + RmDir $INSTDIR ; will only remove if empty (pass /r flag for recursive behavior) Push $R0 StrCpy $R0 $StartMenuGroup 1 StrCmp $R0 ">" no_smgroup diff --git a/dists/nsis/scummvm.nsi.in b/dists/nsis/scummvm.nsi.in index fed88c9700..4238e15f0c 100644 --- a/dists/nsis/scummvm.nsi.in +++ b/dists/nsis/scummvm.nsi.in @@ -237,8 +237,9 @@ Section -post SecMainPost SetOutPath $INSTDIR WriteUninstaller $INSTDIR\uninstall.exe !insertmacro MUI_STARTMENU_WRITE_BEGIN Application + SetShellVarContext all ; Create shortcuts in the all-users folder CreateDirectory "$SMPROGRAMS\$StartMenuGroup" - CreateShortCut "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk" $INSTDIR\$(^Name).exe + CreateShortCut "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk" $INSTDIR\$(^Name).exe "" "$INSTDIR\$(^Name).exe" 0 ; Create shortcut with icon CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Readme.lnk" $INSTDIR\README.txt CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" $INSTDIR\uninstall.exe !insertmacro MUI_STARTMENU_WRITE_END @@ -295,15 +296,22 @@ Section -un.Main SecUninstall SectionEnd Section -un.post SecUninstallPost - DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" + # Remove start menu entries + SetShellVarContext all + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk" + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Readme.lnk" Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" - Delete /REBOOTOK $INSTDIR\uninstall.exe + RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup + + Delete /REBOOTOK $INSTDIR\uninstall.exe + + DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DeleteRegValue HKCU "${REGKEY}" StartMenuGroup DeleteRegValue HKCU "${REGKEY}" InstallPath DeleteRegValue HKCU "${REGKEY}" InstallerLanguage DeleteRegKey /IfEmpty HKCU "${REGKEY}" - RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup - RmDir /REBOOTOK $INSTDIR ; will only remove if empty (pass /r flag for recursive behavior) + + RmDir $INSTDIR ; will only remove if empty (pass /r flag for recursive behavior) Push $R0 StrCpy $R0 $StartMenuGroup 1 StrCmp $R0 ">" no_smgroup |