forked from yt-dlp/yt-dlp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwin7build.bat
68 lines (52 loc) · 1.92 KB
/
win7build.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
REM windows7 python https://github.com/adang1345/PythonWin7/blob/master/3.10.11
@echo off
setlocal enabledelayedexpansion
set "PYTHON_VERSION=3.10.11"
set "PYTHON_DIR_NAME=Python310"
set "isX86=0"
if not defined ProgramFiles(x86) (
echo 32 bit system
set "PYTHON_DIR_NAME=%PYTHON_DIR_NAME%-32"
set "isX86=1"
)
set "PYTHON_PATH=%LOCALAPPDATA%\Programs\Python\%PYTHON_DIR_NAME%"
if not exist "%PYTHON_PATH%" (
set "PYTHON_PATH=%APPDATA%\Python\%PYTHON_DIR_NAME%"
)
set "PATH=%PYTHON_PATH%;%PYTHON_PATH%\Scripts;%PATH%"
echo %PATH%
python -V
for /f "tokens=2" %%i in ('python -V 2^>^&1') do set CUR_PYTHON_VERSION=%%i
if "%CUR_PYTHON_VERSION%" neq "%PYTHON_VERSION%" (
echo Python version is not %PYTHON_VERSION%, exiting...
exit /b 1
)
echo "python version is good!!"
git restore .
git pull
if %isx86% neq 1 (
echo This is x64 architecture
REM Install Requirements
python devscripts/install_deps.py -o --include build
python devscripts/install_deps.py --include curl-cffi
python -m pip install -U "https://yt-dlp.github.io/Pyinstaller-Builds/x86_64/pyinstaller-6.10.0-py3-none-any.whl"
REM Prepare
python devscripts/update-version.py "2024.01.01"
python devscripts/make_lazy_extractors.py
REM Prepare
python -m bundle.pyinstaller --onedir -n yt-dlp
powershell -Command "Compress-Archive -Force -Path ./dist/yt-dlp/* -DestinationPath ./dist/yt-dlp_win7.zip"
) else (
echo This is x32 architecture
REM Install Requirements
python devscripts/install_deps.py -o --include build
python devscripts/install_deps.py
python -m pip install -U "https://yt-dlp.github.io/Pyinstaller-Builds/i686/pyinstaller-6.10.0-py3-none-any.whl"
REM Prepare
python devscripts/update-version.py "2024.01.01"
python devscripts/make_lazy_extractors.py
REM Build
python -m bundle.pyinstaller --onedir -n yt-dlp
powershell -Command "Compress-Archive -Force -Path ./dist/yt-dlp/* -DestinationPath ./dist/yt-dlp_win7_x86.zip"
)
pause