Files
nezhacursormac/build_win.bat
huangzhenpc 96604f7139
Some checks failed
Remove old artifacts / remove-old-artifacts (push) Has been cancelled
first commit: 初始化项目,添加基本功能和打包脚本
2025-02-17 18:58:01 +08:00

54 lines
1.3 KiB
Batchfile

@echo off
setlocal
:: 获取脚本所在目录
cd /d "%~dp0"
:: 检查虚拟环境
if exist "venv\Scripts\activate.bat" (
echo Activating virtual environment...
call venv\Scripts\activate.bat
) else (
echo Creating new virtual environment...
python -m venv venv
call venv\Scripts\activate.bat
echo Installing dependencies...
python -m pip install --upgrade pip
pip install pyinstaller
pip install PyQt5
pip install requests
pip install urllib3
)
:: 执行打包
echo Starting build process...
python -m PyInstaller ^
--name="TingquanHelper" ^
--onefile ^
--windowed ^
--clean ^
--noconfirm ^
--add-data="logger.py;." ^
--add-data="update_cursor_token.py;." ^
--add-data="cursor_auth_manager.py;." ^
--add-data="reset_machine.py;." ^
--add-data="patch_cursor_get_machine_id.py;." ^
--add-data="exit_cursor.py;." ^
--add-data="go_cursor_help.py;." ^
--add-data="logo.py;." ^
--hidden-import=PyQt5 ^
--hidden-import=requests ^
--hidden-import=urllib3 ^
gui/main_window.py
:: 检查打包结果
if exist "dist\TingquanHelper.exe" (
echo Build successful! Executable created at dist\TingquanHelper.exe
) else (
echo Build failed. Please check the error messages.
)
:: 退出虚拟环境
deactivate
endlocal