13
0

Allow silent uninstalls

This commit is contained in:
Nikolaus Gullotta 2020-06-19 14:32:52 -05:00
parent 4053e8cb76
commit d5bae6b9c0
No known key found for this signature in database
GPG Key ID: C1580877951565A3

View File

@ -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'