- 更新build.bat添加依赖检查和清理步骤 - 修改build.spec配置以正确处理Playwright依赖 - 增强SpiderManager中Playwright路径的查找逻辑 - 添加错误处理和调试信息
48 lines
1.3 KiB
Batchfile
48 lines
1.3 KiB
Batchfile
@echo off
|
|
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
|