forked from bertigert/DeezMod
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstaller.bat
More file actions
76 lines (65 loc) · 2.21 KB
/
installer.bat
File metadata and controls
76 lines (65 loc) · 2.21 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
@echo off
set "install_path="
if exist "%~dp0\app.asar" (
if not exist "%~dp0\Deezer.exe" (
echo Installation found on the same level as the installer.
choice /c yn /m "Use this directory? "
if errorlevel 2 goto check_local_app
set "install_path=%~dp0"
) else (
if exist "%~dp0\resources\app.asar" (
echo It seems like you dropped the installer into the main folder of the Deezer installation, not the resources folder. This does not really matter, just wanted to let you know.
choice /c yn /m "Use the directory at %~dp0resources? "
if errorlevel 2 goto check_local_app
set "install_path=%~dp0\resources"
)
)
)
:check_local_app
if "%install_path%"=="" (
if exist "%localappdata%\Programs\deezer-desktop\resources\app.asar" (
echo Installation found at %localappdata%\Programs\deezer-desktop\resources
choice /c yn /m "Use this directory? "
if errorlevel 2 goto specify_install_path
set "install_path=%localappdata%\Programs\deezer-desktop\resources"
)
)
:specify_install_path
if "%install_path%"=="" (
set /p "install_path=No installation found, please specify a path (the path where the app.asar is located, probably ending with \resources), no quotes: "
)
if not exist "%install_path%" (
echo Path is invalid
goto :end
)
:normal_mode
echo.
echo Downloading prepacked app.asar
echo.
curl -s -L -o "%tmp%\app_patched.asar.zip" https://github.com/bertigert/DeezMod/releases/latest/download/app.asar.zip
if not exist "%tmp%\app_patched.asar.zip" (
echo Failed to download app.asar zip
)
echo Extracting app.asar
tar -xf "%tmp%\app_patched.asar.zip" -C %install_path%\
if errorlevel 1 (
echo Failed to extract app.asar zip
)
del "%tmp%\app_patched.asar.zip" >nul
goto :create_plugins_folder
:create_plugins_folder
echo.
if not exist "%localappdata%\DeezMod\Data\plugins" (
echo Creating plugins folder
md "%localappdata%\DeezMod\Data\plugins"
)
goto :end
:end
if exist "%tmp%\app_patched.asar.zip" (
del "%tmp%\app_patched.asar.zip" >nul
)
set "install_path="
echo.
echo Finished, exiting
echo.
pause