-
Notifications
You must be signed in to change notification settings - Fork 4
/
install.bat
executable file
·74 lines (59 loc) · 2.22 KB
/
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
@echo off
setlocal EnableDelayedExpansion
echo Checking for an installed Python version...
REM Check for Python 3 and capture the version output
for /f "delims=" %%i in ('python --version 2^>^&1') do set pyversion=%%i
REM Check if the version string contains "Python 3"
echo !pyversion! | findstr /C:"Python 3" > nul
if %errorlevel% == 0 (
echo Found installed Python: !pyversion!
set py=python
) else (
echo Python 3 is not installed. Please install Python 3.
exit /b 1
)
echo Installing required components
REM Create a virtual environment in the current directory
!py! -m venv venv
REM Dynamically get the current directory's virtual environment activation script
set VENV_DIR=%CD%\venv
if exist "!VENV_DIR!" (
echo Activating virtual environment in !VENV_DIR!
call "!VENV_DIR!\Scripts\activate"
) else (
echo Virtual environment not found in !VENV_DIR!
exit /b 1
)
REM Set the environment variable to force UTF-8 encoding
set PYTHONUTF8=1
REM Install required Python packages
"%VENV_DIR%\Scripts\pip" install --upgrade streamlink aiohttp aiofiles orjson rich
REM Deactivate the virtual environment
call "%VENV_DIR%\Scripts\deactivate"
echo Required components installation completed!
echo Downloading 7zr.exe
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://www.7-zip.org/a/7zr.exe', '7zr.exe')"
echo Downloading ffmpeg-release-full.7z
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full.7z', 'ffmpeg-release-full.7z')"
echo Extracting ffmpeg-release-full.7z
7zr x ffmpeg-release-full.7z -aoa
echo Finding the extracted ffmpeg directory
for /D %%A in (ffmpeg-*) do (
if exist "ffmpeg" (
echo Warning: "ffmpeg" directory already exists. Deleting existing "ffmpeg" directory.
rmdir /s /q "ffmpeg"
echo Renaming "%%A" to "ffmpeg"
rename "%%A" "ffmpeg"
) else (
echo Renaming "%%A" to "ffmpeg"
rename "%%A" "ffmpeg"
)
)
echo Starting configuration
REM Execute the settings script
call settings.bat
echo Configuration completed!
echo If you want to reconfigure, please run the "settings.bat" script directly
REM Pause execution to allow the user to read the output
pause
exit /b 0