-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.bat
More file actions
37 lines (33 loc) · 1.24 KB
/
Copy pathuninstall.bat
File metadata and controls
37 lines (33 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
@echo off
setlocal
set "SCRIPT_DIR=%~dp0"
set "MQB_SHOULD_PAUSE=1"
if /I "%MQB_NO_PAUSE%"=="1" set "MQB_SHOULD_PAUSE=0"
where powershell.exe >nul 2>&1
if errorlevel 1 (
echo [MQB] Windows PowerShell was not found.
if "%MQB_SHOULD_PAUSE%"=="1" pause
exit /b 1
)
if exist "%SCRIPT_DIR%uninstall.ps1" (
powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File "%SCRIPT_DIR%uninstall.ps1" %*
) else if exist "%SCRIPT_DIR%uninstall-mqb.ps1" (
powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File "%SCRIPT_DIR%uninstall-mqb.ps1" %*
) else if exist "%SCRIPT_DIR%install.ps1" (
powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File "%SCRIPT_DIR%install.ps1" -Action Uninstall %*
) else if exist "%SCRIPT_DIR%mqb-install.ps1" (
powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File "%SCRIPT_DIR%mqb-install.ps1" -Action Uninstall %*
) else (
echo [MQB] No MQB uninstall engine was found next to uninstall.bat.
if "%MQB_SHOULD_PAUSE%"=="1" pause
exit /b 1
)
set "RC=%ERRORLEVEL%"
if not "%RC%"=="0" (
echo [MQB] Uninstallation failed with exit code %RC%.
if "%MQB_SHOULD_PAUSE%"=="1" pause
exit /b %RC%
)
echo [MQB] Uninstallation succeeded.
if "%MQB_SHOULD_PAUSE%"=="1" pause
exit /b 0