-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathwindows-install.bat
executable file
·94 lines (77 loc) · 2.85 KB
/
windows-install.bat
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
@echo off
mkdir sideloader_deps 2> NUL
IF EXIST "C:\Program Files\7-Zip\7z.exe" (
echo 7-zip is present
) ELSE (
echo Downloading and installing 7zip'
curl --ssl-no-revoke https://www.7-zip.org/a/7z1900-x64.exe -o sideloader_deps/7zip.exe
START /WAIT sideloader_deps/7zip.exe
)
echo Downloading rclone
curl --ssl-no-revoke -L https://downloads.rclone.org/rclone-current-windows-amd64.zip -o sideloader_deps/rclone.zip
echo Downloading adb
curl --ssl-no-revoke -L https://dl.google.com/android/repository/platform-tools-latest-windows.zip -o sideloader_deps/android-tools.zip
cd sideloader_deps
echo Unzipping rclone
"C:\Program Files\7-Zip\7z.exe" x -y rclone.zip > NUL
echo Unzipping adb
"C:\Program Files\7-Zip\7z.exe" x -y android-tools.zip > NUL
echo Combining folders
SET COPYCMD=/Y
for /d %%a in (rclone-*) do (
move /y %%a\rclone.exe platform-tools\ > NUL
del /F /Q %%a > NUL
rmdir %%a > NUL
)
echo Adding to PATH
:: Get System PATH
for /f "tokens=2*" %%A in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v Path') do set syspath=%%B
:: Get User Path
for /f "tokens=2*" %%A in ('reg query "HKCU\Environment" /v Path') do set userpath=%%B
:: TODO:check if already in path
setx PATH "%userpath%;%~dp0sideloader_deps\platform-tools"
cd ..
IF EXIST "%~dp0sidenoder.exe" (
echo .
) else (
IF EXIST "%programfiles(x86)%\nodejs\node.exe" (
echo NodeJS is present
) ELSE (
echo Downloading and installing NODEJS'
curl --ssl-no-revoke https://nodejs.org/dist/v14.15.1/node-v14.15.1-x86.msi -o sideloader_deps/node-v14.15.1-x86.msi
START /WAIT sideloader_deps/node-v14.15.1-x86.msi
)
IF EXIST "C:\Program Files\Git\cmd\git.exe" (
echo Git is present
) ELSE (
echo Downloading and installing Git
curl --ssl-no-revoke -L https://github.com/git-for-windows/git/releases/download/v2.29.2.windows.2/Git-2.29.2.2-64-bit.exe -o sideloader_deps/Git-2.29.2.2-64-bit.exe
START /WAIT sideloader_deps/Git-2.29.2.2-64-bit.exe
)
)
IF EXIST "%programfiles(x86)%\WinFsp\Bin\diag.bat" (
echo WinFsp is present
echo .
echo .
echo Dependencies installed.
IF EXIST "%~dp0SideNoder.exe" (
echo You can run "SideNoder.exe"
) else (
echo You can run "windows-launcher.bat"
)
pause
exit
) ELSE (
curl --ssl-no-revoke -L https://github.com/billziss-gh/winfsp/releases/download/v1.8/winfsp-1.8.20304.msi -o sideloader_deps/winfsp-1.8.20304.msi
START /WAIT sideloader_deps/winfsp-1.8.20304.msi
echo .
echo .
echo Dependencies installed, Please reboot to complete the installation.
IF EXIST "%~dp0SideNoder.exe" (
echo After rebooting you can run "SideNoder.exe"
) else (
echo "After rebooting you can run \"npm install\"(once) and \"npm start\" to start the SideNoder"
)
pause
exit
)