waf.bat fixes

This commit is contained in:
Alibek Omarov 2023-03-27 23:18:37 +00:00 committed by ita1024
parent c140c3f538
commit be5b485d1d
1 changed files with 5 additions and 9 deletions

View File

@ -5,17 +5,13 @@ rem from issue #964
Setlocal EnableDelayedExpansion
rem Check Windows Version
set TOKEN=tokens=3*
set TOKEN=tokens=2*
ver | findstr /i "5\.0\." > nul
if %ERRORLEVEL% EQU 0 SET TOKEN=tokens=3*
ver | findstr /i "5\.1\." > nul
if %ERRORLEVEL% EQU 0 SET TOKEN=tokens=3*
ver | findstr /i "5\.2\." > nul
if %ERRORLEVEL% EQU 0 SET TOKEN=tokens=3*
ver | findstr /i "6\.0\." > nul
if %ERRORLEVEL% EQU 0 SET TOKEN=tokens=2*
ver | findstr /i "6\.1\." > nul
if %ERRORLEVEL% EQU 0 SET TOKEN=tokens=2*
rem Start calculating PYTHON and PYTHON_DIR
set PYTHON=
@ -26,7 +22,7 @@ Setlocal EnableDelayedExpansion
set PYTHON_DIR_OK=FALSE
set REGPATH=
for %%i in (3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0 2.7 2.6 2.5) do (
for %%i in (3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0 2.7 2.6 2.5) do (
for %%j in (HKCU HKLM) do (
for %%k in (SOFTWARE\Wow6432Node SOFTWARE) do (
for %%l in (Python\PythonCore IronPython) do (
@ -77,7 +73,7 @@ Endlocal & SET PYTHON_DIR=%PYTHON_DIR% & SET PYTHON=%PYTHON%
if "%PYTHON_DIR%" == "" (
rem @echo No Python dir
set PYTHON=python
set PYTHON=py
goto running
)
@ -85,7 +81,7 @@ rem @echo %PYTHON_DIR%
if "%PYTHON%" == "" (
rem @echo No Python
set PYTHON=python
set PYTHON=py
goto running
)
@ -95,4 +91,4 @@ goto running
"%PYTHON%" -x "%~dp0waf" %*
Endlocal
exit /b %ERRORLEVEL%
exit /b %ERRORLEVEL%