Files
guba-indicator/build_new.bat
xiaji 4b406a3727 build: 更新构建配置并添加打包脚本
- 修改build.spec中的路径处理逻辑,使用sys.argv[0]获取当前目录
- 移除PySide6.Qt6Compat的隐藏导入
- 新增build_new.bat打包脚本,包含依赖安装和清理流程
2026-01-21 09:08:29 +08:00

48 lines
1.3 KiB
Batchfile

@echo off
chcp 65001 >nul
echo ========================================
echo 股吧人气指示器 - 打包工具
echo ========================================
REM 检查并安装必要的依赖
echo 检查并安装依赖...
pip install -r requirements.txt
REM 安装Playwright浏览器
echo 安装Playwright浏览器...
python -m playwright install chromium
REM 检查 pyinstaller 是否安装
pip show pyinstaller >nul 2>&1
if errorlevel 1 (
echo 正在安装 pyinstaller...
pip install pyinstaller
)
REM 清理旧的构建文件
echo 清理旧的构建文件...
if exist "build" rmdir /s /q build
if exist "dist" rmdir /s /q dist
if exist "guba-indicator.spec" del guba-indicator.spec
echo 开始打包...
pyinstaller build.spec --noconfirm
if exist "dist\guba-indicator\guba-indicator.exe" (
echo ========================================
echo 打包成功!
echo 可执行文件位置: dist\guba-indicator\guba-indicator.exe
echo ========================================
REM 复制必要的资源文件
echo 复制资源文件...
copy guba.ico dist\guba-indicator\ >nul 2>&1
copy indicator.ico dist\guba-indicator\ >nul 2>&1
copy config.json dist\guba-indicator\ >nul 2>&1
echo 资源文件复制完成!
) else (
echo 打包失败,请检查错误信息
)
pause