Mark called uninstallers rebootok
authorAndre Heinecke <aheinecke@intevation.de>
Fri, 11 Dec 2015 17:12:25 +0000 (18:12 +0100)
committerAndre Heinecke <aheinecke@intevation.de>
Fri, 11 Dec 2015 17:12:25 +0000 (18:12 +0100)
* src/inst-gpg4win.nsi, src/uninst-gnupg-w32.nsi: Mark as rebootok.

--
This is a very very bad workaround the fact that I can't seem
to delete the uninstallers after execution. Have to figure out
why. We also need better killing code as currently rebootok is
triggered nearly always.

src/inst-gpg4win.nsi
src/uninst-gnupg-w32.nsi

index d554a3b..4b7c51a 100644 (file)
@@ -32,10 +32,15 @@ Section "-gpg4win" SEC_gpg4win
   StrCmp $0 "" skip_uninst
   DetailPrint  "$(T_UninstallingOldVersion)$0"
   ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GPG4Win" "UninstallString"
+  IfErrors skip_uninst 0
   ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GPG4Win" "InstallLocation"
+  IfErrors skip_uninst 0
+
   ExecWait '$0 /S _?=$1'
-  Delete "$0"
+# Deleting here does not work?
+  Delete /REBOOTOK "$1\gpg4win-uninstall.exe"
   RmDir "$1"
+
 skip_uninst:
   SetOutPath "$INSTDIR\share\gpg4win"
 
index 0ec906e..a74de4b 100644 (file)
@@ -37,7 +37,7 @@ Section  "un.gnupg_w32"
   StrCmp $0 "" gnupg_w32_not_installed
   DetailPrint  "$(T_Uninstalling_GnuPG) ${gpg4win_pkg_gnupg_w32_version}"
   ExecWait '"$0\gnupg-uninstall.exe" /S _?=$0'
-  Delete "$0\gnupg-uninstall.exe"
+  Delete /REBOOTOK "$0\gnupg-uninstall.exe"
   RmDir "$0"
 gnupg_w32_not_installed:
 !endif