-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.bat
42 lines (39 loc) · 1.34 KB
/
setup.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
@echo off
set "sourceDir=lib"
set "script_path=%~dp0"
set "target_name=biliup.exe"
set "cookie_file=cookie.json"
echo Current script path is: %script_path%
echo =====Checking system architecture...=====
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
echo =====system arch=AMD64=====
set "sourceFile=biliup_win_amd64.exe"
) else if "%PROCESSOR_ARCHITECTURE%"=="ARM64" (
echo =====system arch=ARM64=====
set "sourceFile=biliup_win_arm64.exe"
) else (
echo =====system arch=Unknown=====
exit
)
:: Copy and rename the file if it exists
if not "%sourceFile%"=="" (
if exist "%script_path%\%sourceDir%\%sourceFile%" (
copy /y "%script_path%\%sourceDir%\%sourceFile%" "%script_path%\%target_name%"
echo =====Copied and renamed %sourceFile% to %target_name%=====
) else (
echo =====The file "%script_path%\%sourceDir%\%sourceFile%" does not exist.=====
exit
)
) else (
echo =====Unable to determine system architecture or no matching file found.=====
exit
)
:: Check login status
if not exist "%script_path%\%cookie_file%" (
echo =====No %cookie_file%, need login=====
echo press any key to continue login "%script_path%%target_name%"
pause
start "biliup" "%script_path%%target_name%" "login"
) else (
echo =====You have already logged in=====
)