fix: 修复 Windows 打包问题

- 修复 build.bat: 添加 UTF-8 编码设置
- 修复 spec 文件: 移除不存在的 config.yaml.template
- 添加 README.md 作为数据文件

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
congsh
2026-02-12 16:02:48 +08:00
parent 0ce1d71a90
commit 2d4cd9356e
2 changed files with 23 additions and 14 deletions

View File

@@ -1,5 +1,10 @@
@echo off
REM CutThenThink 极简版本 Windows 打包脚本
REM 使用 UTF-8 编码避免乱码
chcp 65001 >nul
setlocal enabledelayedexpansion
echo ===================================
echo CutThenThink v2.0 极简版构建
@@ -12,35 +17,39 @@ echo - 无重型依赖torch, transformers, paddleocr
echo ===================================
echo.
REM [1/3] 清理旧的构建
echo [1/3] 清理旧的构建...
if exist build rmdir /s /q build
if exist dist rmdir /s /q dist
REM [1/4] 清理旧的构建
echo [1/4] 清理旧的构建...
if exist build rmdir /s /q build 2>nul
if exist dist rmdir /s /q dist 2>nul
REM [2/3] 安装构建依赖
REM [2/4] 安装构建依赖
echo.
echo [2/3] 安装构建依赖...
pip install pyinstaller 2>NUL || echo PyInstaller 已安装
echo [2/4] 安装构建依赖...
pip install pyinstaller 2>nul
if errorlevel 1 (
echo 警告: pip install 失败,请检查网络连接
)
REM [3/3] 构建可执行文件
echo.
echo [3/3] 构建可执行文件...
echo [3/4] 构建可执行文件...
echo.
python -m PyInstaller CutThenThink.spec --clean
if errorlevel 1 (
echo.
echo ===================================
echo 构建失败!
echo ===================================
pause
exit /b 1
)
echo.
echo ===================================
echo 构建成!
echo 构建成
echo ===================================
echo.
echo 输出位置:
echo - dist\CutThenThink\ # 可执行文件目录
echo 输出位置:dist\CutThenThink\
echo.
echo 首次运行前请配置:
echo 1. 可选安装 OCRpip install -r requirements-ocr.txt