diff options
-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 |