TableSynthesis/快速打包.bat
2025-07-02 19:43:52 +08:00

79 lines
1.9 KiB
Batchfile
Raw 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
chcp 65001 >nul
title 座位分配系统 - 快速打包
echo.
echo ╔══════════════════════════════════════╗
echo ║ 座位分配系统 快速打包 ║
echo ╚══════════════════════════════════════╝
echo.
:: 检查Python
python --version >nul 2>&1
if %errorlevel% neq 0 (
echo ❌ Python未安装请先安装Python
goto :error
)
:: 安装打包工具
echo 📦 安装打包工具...
pip install pyinstaller pandas numpy openpyxl --quiet
:: 清理旧文件
echo 🧹 清理旧文件...
if exist "dist" rmdir /s /q "dist"
if exist "build" rmdir /s /q "build"
if exist "release" rmdir /s /q "release"
:: 开始打包
echo 🔨 开始打包...
pyinstaller --onefile --console --name "座位分配系统" --clean seat_allocation_system.py
:: 检查结果
if not exist "dist\座位分配系统.exe" (
echo ❌ 打包失败
goto :error
)
:: 创建发布目录
echo 📁 创建发布目录...
mkdir "release"
copy "dist\座位分配系统.exe" "release\"
:: 创建说明文件
echo 📝 创建说明文件...
(
echo 座位分配系统 v2.0
echo ==================
echo.
echo 使用方法:
echo 1. 将Excel数据文件放在本程序同一目录
echo 2. 双击运行"座位分配系统.exe"
echo 3. 按提示操作即可
echo.
echo 输出文件将保存在log文件夹中
echo.
echo 如有问题请查看log文件夹中的日志
) > "release\使用说明.txt"
:: 完成
echo.
echo ✅ 打包完成!
echo.
echo 📍 发布文件位置: release\座位分配系统.exe
echo 📍 使用说明: release\使用说明.txt
echo.
echo 可以将release文件夹分发给用户使用
goto :end
:error
echo.
echo ❌ 打包失败,请检查错误信息
echo.
pause
exit /b 1
:end
echo.
echo 按任意键退出...
pause >nul