diff --git a/CutThenThink.spec b/CutThenThink.spec index db080ac..2499595 100644 --- a/CutThenThink.spec +++ b/CutThenThink.spec @@ -18,8 +18,8 @@ a = Analysis( pathex=[], binaries=[], datas=[ - # 包含配置文件模板 - ('config.yaml.template', '.'), + # 包含 README 作为说明 + ('README.md', '.'), ], hiddenimports=[ 'PyQt6.QtCore', diff --git a/build.bat b/build.bat index fc439c8..bd83078 100644 --- a/build.bat +++ b/build.bat @@ -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. 可选安装 OCR:pip install -r requirements-ocr.txt