-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathinstaller.bat
More file actions
75 lines (62 loc) · 2.26 KB
/
installer.bat
File metadata and controls
75 lines (62 loc) · 2.26 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
@echo off
setlocal
set "install_path="
if exist "%~dp0\app.asar" (
if exist "%~dp0\Deezer.exe" (
echo It seems you dropped the installer into the main folder, not the resources folder.
choice /c yn /m "Use the directory at %~dp0resources? "
if not errorlevel 2 set "install_path=%~dp0resources"
) else (
echo Installation found in the current directory.
choice /c yn /m "Use this directory? "
if not errorlevel 2 set "install_path=%~dp0"
)
)
: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 1 if not errorlevel 2 set "install_path=%localappdata%\Programs\deezer-desktop\resources"
)
)
:specify_install_path
if "%install_path%"=="" (
set /p "install_path=No installation found, please enter the path to the 'resources' folder (no quotes): "
)
if not exist "%install_path%" (
echo Path is invalid or does not exist.
goto :end
)
:normal_mode
echo.
echo Downloading patched app.asar...
echo.
set "download_url=https://github.com/bertigert/DeezMod/releases/latest/download/app.asar"
curl -s -L -o "%install_path%\app.asar.new" "%download_url%"
if not exist "%install_path%\app.asar.new" (
echo [ERROR] Failed to download app.asar. Check your internet connection or the URL: %download_url%
goto :end
)
echo Replacing app.asar...
if exist "%install_path%\app.asar" (
move /y "%install_path%\app.asar" "%install_path%\app.asar.bak" >nul
)
move /y "%install_path%\app.asar.new" "%install_path%\app.asar" >nul
if errorlevel 1 (
echo [ERROR] Could not replace app.asar. Make sure Deezer is closed!
goto :end
)
echo Patched. Also created a backup of the original app.asar at %install_path%\app.asar.bak.
:create_plugins_folder
echo.
if not exist "%localappdata%\DeezMod\Data\plugins" (
echo Creating plugins folder at %localappdata%\DeezMod\Data\plugins...
md "%localappdata%\DeezMod\Data\plugins"
)
:end
if exist "%install_path%\app.asar.new" del "%install_path%\app.asar.new"
echo.
echo Finished!
echo.
pause