@echo off chcp 936 >nul setlocal EnableExtensions cd /d "%~dp0" title Install deps echo ================================================== echo ������� - ��װ�������廪/�����ƾ��� echo ================================================== echo. echo ˵���������� / �������Ҫ����һ������� exe ��Է�һ�㲻���� pip�� echo Interception �������ܿ� pip װ�� exe���� ������\Interception˵��.txt echo. set "PY=" if exist "%LocalAppData%\Programs\Python\Python311\python.exe" ( set "PY=%LocalAppData%\Programs\Python\Python311\python.exe" ) if not defined PY if exist "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\python.exe" ( set "PY=C:\Users\Administrator\AppData\Local\Programs\Python\Python311\python.exe" ) if not defined PY ( where python >nul 2>nul if not errorlevel 1 set "PY=python" ) if not defined PY ( echo [����] �Ҳ��� Python������װ 3.11+ ����ѡ Add to PATH�� pause exit /b 1 ) echo Python: %PY% "%PY%" -c "import sys; print(' ', sys.version)" echo. set "M1=https://pypi.tuna.tsinghua.edu.cn/simple" set "M2=https://mirrors.aliyun.com/pypi/simple" set "M3=https://pypi.douban.com/simple" set "HOST1=pypi.tuna.tsinghua.edu.cn" set "HOST2=mirrors.aliyun.com" set "HOST3=pypi.douban.com" echo [1/3] ���� pip ... call :pip_try "pip setuptools wheel" if errorlevel 1 goto :fail echo. echo [2/3] ��װ ch\requirements.txt ... call :pip_try "-r ch\requirements.txt" if errorlevel 1 goto :fail echo. echo [3/3] ��װ PyInstaller ... call :pip_try "pyinstaller" if errorlevel 1 goto :fail echo. echo ================================================== echo ������װ��ɡ�����������˫�� ���exe.bat echo ================================================== echo. echo ����׼Ҫ����꣺���밴 ������\Interception˵��.txt ��װ����������һ�Σ��� echo. pause exit /b 0 :fail echo. echo [����] ��װʧ�ܡ����ֶ��ԣ� echo "%PY%" -m pip install -i %M1% --trusted-host %HOST1% -r ch\requirements.txt echo "%PY%" -m pip install -i %M2% --trusted-host %HOST2% -r ch\requirements.txt pause exit /b 1 :pip_try set "ARGS=%~1" echo ���廪... "%PY%" -m pip install -i %M1% --trusted-host %HOST1% %ARGS% if not errorlevel 1 exit /b 0 echo �԰���... "%PY%" -m pip install -i %M2% --trusted-host %HOST2% %ARGS% if not errorlevel 1 exit /b 0 echo �Զ���... "%PY%" -m pip install -i %M3% --trusted-host %HOST3% %ARGS% if not errorlevel 1 exit /b 0 echo �Թٷ�... "%PY%" -m pip install %ARGS% if not errorlevel 1 exit /b 0 exit /b 1