From 4db35028b417e5192515067c4ed95ed587f5b303 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 3 Apr 2015 16:45:19 +0200 Subject: fix: windows uninstall before re-install --- tools/x-win/package.sh | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'tools/x-win') diff --git a/tools/x-win/package.sh b/tools/x-win/package.sh index 221a07bba4..ee1aeea319 100755 --- a/tools/x-win/package.sh +++ b/tools/x-win/package.sh @@ -329,14 +329,29 @@ Function .onInit StrCmp \$R0 "" done MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \ - "${PROGRAM_NAME} is already installed. \$\\n\$\\nClick 'OK' to remove the \ - previous version or 'Cancel' to cancel this upgrade." \ + "${PROGRAM_NAME} is already installed. Click 'OK' to remove the previous version or 'Cancel' to cancel this upgrade." \ IDOK uninst Abort uninst: - ClearErrors - Exec \$INSTDIR\uninst.exe ; + ClearErrors + ExecWait '\$R0 _?=\$INSTDIR' + IfErrors uninstall_error + + ReadRegStr \$R1 HKLM \ + "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${PRODUCT_ID}" \ + "UninstallString" + StrCmp \$R1 "" 0 done + + Delete "\$INSTDIR\\uninstall.exe" + RMDir "\$INSTDIR" + goto done + + uninstall_error: + + MessageBox MB_OK|MB_ICONEXCLAMATION \ + "Uninstaller did not complete successfully. Continue at your own risk..." \ + IDOK done done: -- cgit v1.2.3