b97d79e13a
Separate persistent user data from application code (data/work_tracker.db, data/uploads, data/storage) with idempotent legacy migration and SQLite integrity checks. Add offline packaging scripts for a Windows x11 x64 portable ZIP (embeddable Python, Start/Stop/Backup.bat). Fix launcher: no multiline python -c in BAT and no os.dup2 — uvicorn runs detached with wvt.log; health wait and busy-port diagnostics included.
40 lines
1.0 KiB
Batchfile
40 lines
1.0 KiB
Batchfile
@echo off
|
|
setlocal EnableExtensions
|
|
chcp 65001 >nul
|
|
set "APP_HOME=%~dp0"
|
|
set "DATA=%APP_HOME%data"
|
|
set "BK=%APP_HOME%backups"
|
|
set "PY=%APP_HOME%python\python.exe"
|
|
set "SCRIPTS=%APP_HOME%scripts"
|
|
set "LOGDIR=%APP_HOME%data\logs"
|
|
set "BKLOG=%LOGDIR%\startup.log"
|
|
|
|
if not exist "%PY%" (
|
|
echo [ERROR] Local Python not found: %PY%
|
|
pause
|
|
exit /b 1
|
|
)
|
|
if not exist "%DATA%" mkdir "%DATA%"
|
|
if not exist "%BK%" mkdir "%BK%"
|
|
if not exist "%LOGDIR%" mkdir "%LOGDIR%"
|
|
|
|
echo Creating backup...
|
|
echo ==== BACKUP %DATE% %TIME% ====>> "%BKLOG%"
|
|
|
|
"%PY%" "%SCRIPTS%\backup_data.py" "%DATA%" "%BK%" > "%TEMP%\wvt_backup_out.txt" 2> "%TEMP%\wvt_backup_err.txt"
|
|
set "BKERR=%ERRORLEVEL%"
|
|
type "%TEMP%\wvt_backup_out.txt" >> "%BKLOG%"
|
|
type "%TEMP%\wvt_backup_err.txt" >> "%BKLOG%"
|
|
|
|
if %BKERR% NEQ 0 (
|
|
echo [ERROR] Backup failed. See %BKLOG%
|
|
if exist "%TEMP%\wvt_backup_err.txt" type "%TEMP%\wvt_backup_err.txt"
|
|
pause
|
|
exit /b 2
|
|
)
|
|
|
|
set /p OUTZIP=<"%TEMP%\wvt_backup_out.txt"
|
|
echo Backup created: %OUTZIP%
|
|
echo BACKUP_OK %OUTZIP%>> "%BKLOG%"
|
|
exit /b 0
|