-
Notifications
You must be signed in to change notification settings - Fork 0
/
Uninstall.cmd
58 lines (50 loc) · 1.17 KB
/
Uninstall.cmd
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
@echo off
set appname=BDOLauncher Enhanced
set title=%appname% Uninstaller
set path=%~dp0\nodejs\;%path%
title %title%
:check_requirements
echo Checking Requirements...
call node -v >nul 2>&1 && call npm -v >nul 2>&1
title %title%
if %errorlevel% neq 0 (
echo Failed to find the required Node.js binaries.
goto :error
)
echo Checked Requirements.
echo.
goto :update_dependencies
:update_dependencies
echo Updating Dependencies...
call npm install
title %title%
if %errorlevel% neq 0 goto :error
echo.
echo Updated Dependencies.
echo.
goto :execute_pre_uninstall
:execute_pre_uninstall
echo Executing Pre-Uninstall Script...
call node "%localappdata%\%appname%\app.js" uninstall
if %errorlevel% neq 0 goto :error
echo Executed Pre-Uninstall Script.
echo.
goto :uninstall_application
:uninstall_application
echo Uninstalling %appname% from LocalAppData...
rmdir /s /q "%localappdata%\%appname%\" >nul 2>&1
if %errorlevel% neq 0 goto :error
echo Uninstalled %appname% from LocalAppData.
echo.
goto :completed
:completed
echo The uninstallation was completed.
echo.
pause
exit
:error
echo.
echo Error occurred during uninstallation. The uninstallation was canceled.
echo.
pause
exit