Fix MBAM uninstall

This commit is contained in:
2Shirt 2019-11-16 13:49:42 -07:00
parent 21e15272e4
commit 2eaf7b0230
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -24,6 +24,7 @@ set iso_date=%_yyyy%-%_mm%-%_dd%
rem Get uninstaller path from registry
set "uninstaller="
set "altuninstaller=%PROGRAMFILES%\Malwarebytes\Anti-Malware\mbuns.exe"
for /f usebackq^ tokens^=2^ delims^=^" %%s in (
`reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{35065F43-4BB2-439A-BFF7-0F1014F2E0CD}_is1" /v UninstallString`
) do (
@ -47,17 +48,24 @@ if exist "%SYSTEMDRIVE%\1201\Preserve-MBAM.marker" (
if exist "%uninstaller%" (
echo "Uninstalling Malwarebytes..."
start "" /wait "%uninstaller%" /VERYSILENT /NORESTART /LOG
) else (
goto Done
)
if exist "%altuninstaller%" (
rem MBAM 4.x workaround
echo "Uninstalling Malwarebytes..."
start "" /wait "%altuninstaller%" /Uninstall /VERYSILENT /NORESTART /LOG
goto Done
)
color 4e
echo "Malwarebytes installation not found."
echo ""
echo "Press any key to exit... "
pause >nul
)
)
:Done
rem Remove marker
del /f "%SYSTEMDRIVE%\1201\Preserve-MBAM.marker"
del /f "%SYSTEMDRIVE%\1201\Preserve-MBAM.marker" 2>nul
popd
endlocal