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'