Files
cutThenThink/build.bat
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

59 lines
1.4 KiB
Batchfile
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@echo off
REM CutThenThink 极简版本 Windows 打包脚本
REM 使用 UTF-8 编码避免乱码
chcp 65001 >nul
setlocal enabledelayedexpansion
echo ===================================
echo CutThenThink v2.0 极简版构建
echo ===================================
echo.
echo 特点:
echo - 核心依赖PyQt6, requests, Pillow
echo - 可选 OCRRapidOCR 插件
echo - 无重型依赖torch, transformers, paddleocr
echo ===================================
echo.
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/4] 安装构建依赖
echo.
echo [2/4] 安装构建依赖...
pip install pyinstaller 2>nul
if errorlevel 1 (
echo 警告: pip install 失败,请检查网络连接
)
echo.
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 输出位置dist\CutThenThink\
echo.
echo 首次运行前请配置:
echo 1. 可选安装 OCRpip install -r requirements-ocr.txt
echo 2. 配置文件:%%USERPROFILE%%\.cutthenthink\config.yaml
echo.
pause