Call gnupg uninstaller on uninstall
authorAndre Heinecke <aheinecke@intevation.de>
Wed, 23 Sep 2015 14:41:02 +0000 (16:41 +0200)
committerAndre Heinecke <aheinecke@intevation.de>
Wed, 23 Sep 2015 14:41:02 +0000 (16:41 +0200)
* src/uninst-gnupg-w32.nsi: Call gnupg-uninstaller on uninstall.

src/uninst-gnupg-w32.nsi

index c9adef2..c7cea5a 100644 (file)
 
 
 # Uninstaller section.
-Section "un.gnupg_w32"
+Section  "un.gnupg_w32"
 !ifdef SOURCES
   Push "${gpg4win_pkg_gnupg_w32}"
   Call un.SourceDelete
 !else
-  # TODO: Read gnupg uninstaller from registry.
+  ReadRegStr $0 HKLM "Software\GnuPG" "Install Directory"
+  # It is possible that someone uninstalled gnupg without uninstalling
+  # gpg4win
+  StrCmp $0 "" gnupg_w32_not_installed
+  DetailPrint  "$(T_Uninstalling_GnuPG) ${gpg4win_pkg_gnupg_w32_version}"
+  ExecWait '"$0\gnupg-uninstall.exe" /S'
+gnupg_w32_not_installed:
 !endif
 SectionEnd
+
+LangString T_UnInstalling_GnuPG ${LANG_ENGLISH} \
+   "Uninstalling GnuPG"