Files

61 lines
1.4 KiB
Batchfile

@echo off
rem ============================================================
rem RecorderStudio launcher (ASCII only, safe in any code page)
rem Picks a Python that has PyQt5, adds the project-local
rem _vendor directory to the module path, then starts the GUI.
rem ============================================================
setlocal
cd /d "%~dp0"
title RecorderStudio
set "PYEXE="
call :try python
if not defined PYEXE call :try "py -3.12"
if not defined PYEXE call :try "py -3.13"
if not defined PYEXE call :try "py -3.11"
if not defined PYEXE call :try "py -3"
if not defined PYEXE call :try "python3"
if not defined PYEXE goto :nodeps
set "PYTHONPATH=%~dp0_vendor;%PYTHONPATH%"
set "PYTHONUTF8=1"
echo interpreter : %PYEXE%
%PYEXE% -c "import sys; print(' python :', sys.version.split()[0])"
echo starting RecorderStudio GUI ...
echo.
%PYEXE% -m recorder.gui %*
if errorlevel 1 goto :failed
endlocal
exit /b 0
:try
%~1 -c "import PyQt5" >nul 2>&1
if %errorlevel%==0 set "PYEXE=%~1"
goto :eof
:nodeps
echo.
echo No Python with PyQt5 was found.
echo.
echo Install the dependencies first:
echo python install_deps.py --with-pyqt5
echo.
echo Or install them manually:
echo pip install --target _vendor sounddevice PyQt5
echo.
pause
endlocal
exit /b 2
:failed
echo.
echo Startup failed. Diagnostics:
echo %PYEXE% -m recorder.selftest --no-hw
echo %PYEXE% install_deps.py --check
echo.
pause
endlocal
exit /b 1