Compare commits

...

1 Commits

Author SHA1 Message Date
congsh
2d4cd9356e fix: 修复 Windows 打包问题
- 修复 build.bat: 添加 UTF-8 编码设置
- 修复 spec 文件: 移除不存在的 config.yaml.template
- 添加 README.md 作为数据文件

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 16:02:48 +08:00
2 changed files with 23 additions and 14 deletions

View File

@@ -18,8 +18,8 @@ a = Analysis(
pathex=[], pathex=[],
binaries=[], binaries=[],
datas=[ datas=[
# 包含配置文件模板 # 包含 README 作为说明
('config.yaml.template', '.'), ('README.md', '.'),
], ],
hiddenimports=[ hiddenimports=[
'PyQt6.QtCore', 'PyQt6.QtCore',

View File

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