From d5bae6b9c06b25b789aae474b4978f8a910e85fc Mon Sep 17 00:00:00 2001 From: Nikolaus Gullotta Date: Fri, 19 Jun 2020 14:32:52 -0500 Subject: [PATCH] Allow silent uninstalls --- tools/x-win/package.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/x-win/package.sh b/tools/x-win/package.sh index eedec18625..1b430971a4 100755 --- a/tools/x-win/package.sh +++ b/tools/x-win/package.sh @@ -540,11 +540,25 @@ Function .onInit "UninstallString" StrCmp \$R0 "" done + IfSilent silentuninst + MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \ "${PROGRAM_NAME} is already installed. Click 'OK' to remove the previous version or 'Cancel' to cancel this upgrade." \ IDOK uninst Abort + silentuninst: + ExecWait '\$R0 /S _?=\$INSTDIR' + + ReadRegStr \$R1 HKLM \ + "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${PRODUCT_ID}-${WARCH}" \ + "UninstallString" + StrCmp \$R1 "" 0 done + + Delete "\$INSTDIR\\uninstall.exe" + RMDir "\$INSTDIR" + goto done + uninst: ClearErrors ExecWait '\$R0 _?=\$INSTDIR'