diff --git a/build_new.bat b/build_new.bat new file mode 100644 index 0000000..fc1507d --- /dev/null +++ b/build_new.bat @@ -0,0 +1,48 @@ +@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 \ No newline at end of file