Files
Арсентьев Александр b97d79e13a feat: portable Windows data layout and launcher package
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.
2026-10-20 15:55:04 +03:00

34 lines
874 B
Batchfile

@echo off
setlocal EnableExtensions
chcp 65001 >nul
set "APP_HOME=%~dp0"
set "PORT=8000"
set "PY=%APP_HOME%python\python.exe"
set "SCRIPTS=%APP_HOME%scripts"
set "PIDFILE=%APP_HOME%data\wvt.pid"
set "LOGDIR=%APP_HOME%data\logs"
set "STOPLOG=%LOGDIR%\startup.log"
echo Stopping Work Volume Tracker...
echo ==== STOP %DATE% %TIME% ====>> "%STOPLOG%"
if exist "%PIDFILE%" (
set /p PID=<"%PIDFILE%"
if defined PID (
if not "%PID%"=="" (
taskkill /PID %PID% /F >nul 2>&1
)
)
)
if exist "%PY%" (
"%PY%" "%SCRIPTS%\stop_port.py" %PORT% >> "%STOPLOG%" 2>&1
) else (
powershell -NoProfile -Command "Get-NetTCPConnection -LocalPort %PORT% -State Listen -ErrorAction SilentlyContinue | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force }" >nul 2>&1
)
if exist "%PIDFILE%" del "%PIDFILE%" >nul 2>&1
echo Stopped.
echo STOPPED>> "%STOPLOG%"
exit /b 0