@echo off
setlocal
cd /d "%~dp0"
echo Starting LIVA CORE Trial...

python --version >nul 2>&1
if errorlevel 1 (
  echo Python was not found.
  echo Please install Python 3.10 or newer from https://www.python.org/downloads/
  pause
  exit /b 1
)

if not exist ".venv\Scripts\python.exe" (
  echo Creating local Python environment...
  python -m venv .venv
)

echo Installing/updating required packages...
".venv\Scripts\python.exe" -m pip install --upgrade pip
".venv\Scripts\python.exe" -m pip install -r requirements.txt

echo Opening LIVA CORE Trial at http://localhost:8501
".venv\Scripts\python.exe" -m streamlit run app.py --server.port 8501 --server.headless true --server.fileWatcherType none --browser.gatherUsageStats false
pause
