Improve Python launcher discovery docs
This commit is contained in:
+39
-5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user