@echo off
rem Pancake printer: one time setup (Claude for Andrin). Creates .venv next to this file.
setlocal
cd /d "%~dp0"
echo === Pancake printer setup ===
set "PY=python"
where py >nul 2>nul && set "PY=py -3"
if not exist ".venv\Scripts\python.exe" (
    echo Creating .venv with %PY% ...
    %PY% -m venv .venv || goto :fail
)
set "VPY=.venv\Scripts\python.exe"
"%VPY%" -m pip install --upgrade pip
echo.
echo --- team requirements (Aaron: team\software\requirements.txt)
"%VPY%" -m pip install -r team\software\requirements.txt || goto :fail
echo.
echo --- serial ports (ufp) and the photo converter
"%VPY%" -m pip install pyserial pillow scipy contourpy || goto :fail
echo.
echo --- background removal for photos (optional, about 200 MB with the model)
"%VPY%" -m pip install "rembg[cpu]" || echo rembg could not be installed: photos will keep their background.
echo.
echo Setup done. Start the GUI with run_gui.bat
pause
exit /b 0
:fail
echo.
echo Setup failed, see the message above. Python 3.10 to 3.13 from python.org works best.
pause
exit /b 1
