Files
school-meal/build_installer.bat
Chunyu ffe44f4cb1 fix: 修复 EXE 数据库 schema 不匹配导致 500 错误
- ISS 移除 onlyifdoesntexist 确保安装目录 db.sqlite3 始终更新

- .gitignore 忽略所有 sqlite3 文件

- 前端翻页组件和样式更新
2026-08-29 13:49:23 +08:00

93 lines
2.5 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
chcp 65001 >nul
echo ==========================================
echo 学校订餐菜单生成器 - 一键打包安装包
echo ==========================================
cd /d %~dp0
echo.
echo [1/4] 检查 Python 环境...
python --version >nul 2>&1
if errorlevel 1 (
echo 错误: 未找到 Python,请先安装 Python 3.10+
pause
exit /b 1
)
python --version
echo.
echo [2/4] 构建 EXE(如已构建可跳过)...
if not exist "dist\school-meal\school-meal.exe" (
echo 未找到已构建的 EXE,开始构建...
python build.py
if errorlevel 1 (
echo.
echo EXE 构建失败!
pause
exit /b 1
)
) else (
echo 已检测到 dist\school-meal\school-meal.exe,跳过构建。
echo 如需重新构建,请先执行 python build.py --clean
)
echo.
echo [3/4] 检查 Inno Setup 编译器...
set "ISCC="
if exist "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" (
set "ISCC=C:\Program Files (x86)\Inno Setup 6\ISCC.exe"
) else if exist "C:\Program Files\Inno Setup 6\ISCC.exe" (
set "ISCC=C:\Program Files\Inno Setup 6\ISCC.exe"
) else if exist "C:\Program Files (x86)\Inno Setup 5\ISCC.exe" (
set "ISCC=C:\Program Files (x86)\Inno Setup 5\ISCC.exe"
) else if exist "C:\Program Files\Inno Setup 5\ISCC.exe" (
set "ISCC=C:\Program Files\Inno Setup 5\ISCC.exe"
) else (
where iscc >nul 2>&1
if not errorlevel 1 (
set "ISCC=iscc"
)
)
if "%ISCC%"=="" (
echo.
echo 错误: 未找到 Inno Setup 编译器!
echo.
echo 请安装 Inno Setup 6:
echo https://jrsoftware.org/isdl.php
echo.
echo 安装完成后请重新运行此脚本。
pause
exit /b 1
)
echo 找到 Inno Setup: %ISCC%
echo.
echo [3.5/4] 验证语言文件...
for %%I in ("%ISCC%") do set "ISDIR=%%~dpI"
if not exist "%ISDIR%Languages\ChineseSimplified.isl" (
echo.
echo 警告: 未找到中文语言文件 ChineseSimplified.isl
echo 安装向导将使用英文界面。
echo 如需中文界面,请确保 Inno Setup 完整安装。
)
echo.
echo [4/4] 编译安装包...
"%ISCC%" school-meal-setup.iss
if errorlevel 1 (
echo.
echo 安装包编译失败!请检查上方错误信息。
pause
exit /b 1
)
echo.
echo ==========================================
echo 安装包构建完成!
echo ==========================================
echo 输出目录: installer\
echo 安装包: installer\学校订餐菜单生成器-安装包.exe
echo ==========================================
echo.
pause