chore: Add batch scripts for build, deployment, and configuration

- Remove *.bat from .gitignore to track build and utility scripts
- Add build.bat for automated PyInstaller packaging with dependency checks
- Add run_gui.bat for launching the GUI application with error handling
- Add 启动工具.bat interactive menu for accessing all project tools and operations
- Add 修复并重新打包.bat comprehensive build script with COM component fixes
- Add 配置API密钥.bat utility for configuring API keys in config.json
- Enable version control of batch scripts for easier distribution and maintenance
This commit is contained in:
2026-02-11 16:32:01 +08:00
parent b66bac7ca8
commit e28e91f1d5
6 changed files with 348 additions and 1 deletions

113
修复并重新打包.bat Normal file
View File

@@ -0,0 +1,113 @@
@echo off
chcp 65001 >nul
title 修复COM组件问题并重新打包
color 0E
echo ╔════════════════════════════════════════╗
echo ║ 修复COM组件问题并重新打包 ║
echo ╚════════════════════════════════════════╝
echo.
echo [步骤 1/5] 检查Python环境...
python --version >nul 2>&1
if errorlevel 1 (
echo [错误] Python未安装或未添加到PATH
pause
exit /b 1
)
python --version
echo [OK] Python环境正常
echo.
echo [步骤 2/5] 安装/更新pywin32...
pip install --upgrade pywin32
if errorlevel 1 (
echo [错误] pywin32安装失败
pause
exit /b 1
)
echo [OK] pywin32已安装
echo.
echo [步骤 3/5] 安装/更新PyInstaller...
pip install --upgrade pyinstaller
if errorlevel 1 (
echo [错误] PyInstaller安装失败
pause
exit /b 1
)
echo [OK] PyInstaller已安装
echo.
echo [步骤 4/5] 清理旧的构建文件...
if exist build (
rmdir /s /q build
echo 已删除 build 目录
)
if exist dist (
rmdir /s /q dist
echo 已删除 dist 目录
)
if exist "微信岗位提取工具.spec" (
del "微信岗位提取工具.spec"
echo 已删除旧的spec文件
)
echo [OK] 清理完成
echo.
echo [步骤 5/5] 开始打包...
echo 这可能需要几分钟,请耐心等待...
echo.
pyinstaller build_exe.spec
if errorlevel 1 (
echo.
echo ════════════════════════════════════════
echo [失败] 打包过程出现错误
echo ════════════════════════════════════════
echo.
echo 可能的原因:
echo 1. 缺少某些依赖包
echo 2. 文件被占用
echo 3. 磁盘空间不足
echo.
echo 请查看上方的错误信息,或尝试:
echo - 关闭所有相关程序
echo - 以管理员身份运行此脚本
echo - 手动运行: pip install -r requirements.txt
echo.
pause
exit /b 1
)
echo.
echo ════════════════════════════════════════
echo [成功] 打包完成!
echo ════════════════════════════════════════
echo.
echo 可执行文件位置: dist\微信岗位提取工具.exe
echo 文件大小:
dir "dist\微信岗位提取工具.exe" | find "微信岗位提取工具.exe"
echo.
echo ════════════════════════════════════════
echo 测试建议:
echo ════════════════════════════════════════
echo 1. 确保微信 3.9 已登录
echo 2. 运行: dist\微信岗位提取工具.exe
echo 3. 配置目标群组和API密钥
echo 4. 点击"开始任务"测试
echo 5. 检查是否还有COM错误
echo.
echo 如果仍有问题,请查看"打包问题修复说明.md"
echo.
set /p test=是否立即测试运行?(Y/N):
if /i "%test%"=="Y" (
echo.
echo 正在启动程序...
start "" "dist\微信岗位提取工具.exe"
)
echo.
echo 完成!
pause