-
Notifications
You must be signed in to change notification settings - Fork 0
/
DownloadSDK.cmd
42 lines (34 loc) · 1.25 KB
/
DownloadSDK.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
@echo off
setlocal enabledelayedexpansion
set LL_SDK_REMOTE_PATH=https://github.com/LiteLDev/LiteLoaderSDK.git
set LL_SDK_USE_BRANCH=main
set LL_SDK_DIRECTORY_PATH=SDK
rem Process System Proxy
for /f "tokens=3* delims= " %%i in ('Reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable') do (
if %%i==0x1 (
echo [INFO] System Proxy enabled. Adapting Settings...
for /f "tokens=3* delims= " %%a in ('Reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer') do set PROXY_ADDR=%%a
set http_proxy=http://!PROXY_ADDR!
set https_proxy=http://!PROXY_ADDR!
echo [INFO] System Proxy enabled. Adapting Settings finished.
echo.
)
)
echo [INFO] Upgrading LL-SDK from GitHub ...
echo.
git stash save "Uploading LL SDK..."
echo.
if not exist %LL_SDK_DIRECTORY_PATH% (
git subtree add --prefix=%LL_SDK_DIRECTORY_PATH% %LL_SDK_REMOTE_PATH% %LL_SDK_USE_BRANCH% --squash
) else (
git subtree pull --prefix=%LL_SDK_DIRECTORY_PATH% %LL_SDK_REMOTE_PATH% %LL_SDK_USE_BRANCH% --squash
)
git stash pop -q
echo.
echo [INFO] Upgrading LL-SDK from GitHub finished.
echo.
echo.
echo [INFO] Upgrade end successfully.
if [%1]==[action] goto End
timeout /t 3 >nul
:End