Files
tianxuan/update.bat
T
PM-pinou 7a670fd5e2 feat(scripts): add update.bat and rollback.bat launchers
Add user-facing launchers for the incremental update system:
- update.bat: one-click update launcher
- rollback.bat: rollback to previous version
- tests/test_update_integration.py: integration tests for the update system
- README.md: add incremental update guide (section 10)
- .gitignore: add .update_cache/ entry

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-20 14:14:17 +08:00

57 lines
1.4 KiB
Batchfile

@echo off
chcp 65001 >nul
cd /d "%~dp0"
echo ================================================
echo 天璇 增量更新工具
echo ================================================
echo.
:: Auto-detect update package
set ZIP_FILE=%1
if "%ZIP_FILE%"=="" (
for %%f in (tianxuan_update_*.zip) do set ZIP_FILE=%%f
)
if "%ZIP_FILE%"=="" (
echo [ERROR] 未找到任何 tianxuan_update_*.zip 文件
echo 请将更新包(tianxuan_update_*.zip)放到本目录后重试
pause
exit /b 1
)
if not exist "%ZIP_FILE%" (
echo [ERROR] 找不到更新包: %ZIP_FILE%
pause
exit /b 1
)
echo 更新包: %ZIP_FILE%
echo.
:: Check portable Python exists
if not exist "runtime\python\python.exe" (
echo [ERROR] 找不到便携 Python 运行时
echo 请确保 runtime\python\python.exe 存在
pause
exit /b 1
)
:: Run the update script
echo 正在应用更新,请勿关闭此窗口...
echo.
runtime\python\python.exe scripts\apply_update.py "%ZIP_FILE%"
if %ERRORLEVEL% neq 0 (
echo.
echo [ERROR] 更新失败!错误代码: %ERRORLEVEL%
echo 请运行 rollback.bat 回滚到更新前的状态
pause
exit /b %ERRORLEVEL%
)
echo.
echo ================================================
echo ✅ 更新完成!
echo ================================================
echo.
echo 请关闭此窗口,然后重新双击 run.bat 启动新版本
echo.
pause