Improve Python launcher discovery docs

This commit is contained in:
Melbar
2026-05-08 08:35:41 +02:00
parent df64b9b13b
commit 5eb989f2ba
2 changed files with 93 additions and 8 deletions
+39 -5
View File
@@ -1,8 +1,42 @@
@echo off
set "PYTHON_EXE=%LocalAppData%\Programs\Python\Python311\python.exe"
if exist "%PYTHON_EXE%" (
"%PYTHON_EXE%" "%~dp0pvd_mezzanine.py" %*
) else (
py -3 "%~dp0pvd_mezzanine.py" %*
setlocal
set "SCRIPT=%~dp0pvd_mezzanine.py"
set "PYTHON_EXE="
set "PYTHON_ARGS="
for %%V in (313 312 311 310) do (
if not defined PYTHON_EXE if exist "%LocalAppData%\Programs\Python\Python%%V\python.exe" (
set "PYTHON_EXE=%LocalAppData%\Programs\Python\Python%%V\python.exe"
)
)
if not defined PYTHON_EXE (
where py.exe >nul 2>nul
if not errorlevel 1 (
set "PYTHON_EXE=py"
set "PYTHON_ARGS=-3"
)
)
if not defined PYTHON_EXE (
where python.exe >nul 2>nul
if not errorlevel 1 set "PYTHON_EXE=python"
)
if not defined PYTHON_EXE (
where python3.exe >nul 2>nul
if not errorlevel 1 set "PYTHON_EXE=python3"
)
if not defined PYTHON_EXE (
echo FEHLER: Python wurde nicht gefunden.
echo Bitte Python 3.10 oder neuer installieren:
echo https://www.python.org/downloads/windows/
echo.
echo Im Installer "Add python.exe to PATH", "py launcher" und "tcl/tk and IDLE" aktivieren.
pause
exit /b 1
)
"%PYTHON_EXE%" %PYTHON_ARGS% "%SCRIPT%" %*
pause