@echo off setlocal chcp 65001 >nul title PLSR Python Upper Computer cd /d "%~dp0" set "PYTHONUTF8=1" set "PYTHONIOENCODING=utf-8" set "PYTHON_EXE=%USERPROFILE%\.cache\codex-runtimes\codex-primary-runtime\dependencies\python\python.exe" set "PYTHON_ARGS=" if exist "%PYTHON_EXE%" goto python_found where py >nul 2>nul if not errorlevel 1 ( set "PYTHON_EXE=py" set "PYTHON_ARGS=-3" goto python_found ) where python >nul 2>nul if not errorlevel 1 ( set "PYTHON_EXE=python" goto python_found ) echo No usable Python runtime was found. echo Install Python 3.9 or later, then run this file again. pause exit /b 1 :python_found "%PYTHON_EXE%" %PYTHON_ARGS% -c "import serial" >nul 2>nul if errorlevel 1 ( echo Installing pyserial... "%PYTHON_EXE%" %PYTHON_ARGS% -m pip install -r requirements.txt if errorlevel 1 ( echo Failed to install pyserial. pause exit /b 1 ) ) "%PYTHON_EXE%" %PYTHON_ARGS% plsr_gui.py set "PLSR_EXIT=%ERRORLEVEL%" if not "%PLSR_EXIT%"=="0" ( echo. echo PLSR GUI exited with code %PLSR_EXIT%. pause ) exit /b %PLSR_EXIT%