summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-04-03 16:45:19 +0200
committerRobin Gareus <robin@gareus.org>2015-04-03 17:07:25 +0200
commit4db35028b417e5192515067c4ed95ed587f5b303 (patch)
tree8e2a2ab3020af2e083e68c2075fead4b70731c73
parent4a44f9021841a67ffc9824b1aa1d658add922739 (diff)
fix: windows uninstall before re-install
-rwxr-xr-xtools/x-win/package.sh23
1 files changed, 19 insertions, 4 deletions
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: