Browse Source

waf.bat: correctly parse reg query on Windows 10+, fallback only to py.exe wrapper

pull/2/head
Alibek Omarov 2 years ago
parent
commit
060835cf2f
  1. 8
      waf.bat

8
waf.bat

@ -8,17 +8,13 @@ rem from issue #964
Setlocal EnableDelayedExpansion Setlocal EnableDelayedExpansion
rem Check Windows Version rem Check Windows Version
set TOKEN=tokens=3* set TOKEN=tokens=2*
ver | findstr /i "5\.0\." > nul ver | findstr /i "5\.0\." > nul
if %ERRORLEVEL% EQU 0 SET TOKEN=tokens=3* if %ERRORLEVEL% EQU 0 SET TOKEN=tokens=3*
ver | findstr /i "5\.1\." > nul ver | findstr /i "5\.1\." > nul
if %ERRORLEVEL% EQU 0 SET TOKEN=tokens=3* if %ERRORLEVEL% EQU 0 SET TOKEN=tokens=3*
ver | findstr /i "5\.2\." > nul ver | findstr /i "5\.2\." > nul
if %ERRORLEVEL% EQU 0 SET TOKEN=tokens=3* 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 rem Start calculating PYTHON and PYTHON_DIR
set PYTHON= set PYTHON=
@ -88,7 +84,7 @@ rem @echo %PYTHON_DIR%
if "%PYTHON%" == "" ( if "%PYTHON%" == "" (
rem @echo No Python rem @echo No Python
set PYTHON=python set PYTHON=py
goto running goto running
) )

Loading…
Cancel
Save