diff --git a/build.vc10/make.bat b/build.vc10/make.bat index b8413ec1..24ff13ac 100644 --- a/build.vc10/make.bat +++ b/build.vc10/make.bat @@ -76,22 +76,16 @@ if errorlevel 1 ( exit /b 1 ) cd mpir-tests -python --version >nul 2>&1 +@echo off +for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (set _my_=%%f %%g) if not errorlevel 1 goto :got -if exist c:\Python26 ( - set "PATH=%PATH%;c:\Python26" - python --version >nul 2>&1 - if not errorlevel 1 goto :got -) -if exist c:\Python30 ( - set "PATH=%PATH%;c:\Python30" - python --version >nul 2>&1 - if not errorlevel 1 goto :got -) echo ERROR Could not find PYTHON exit /b 1 :got -python run-tests.py noenter +set _res_=%_my_:*REG_SZ=% +set _end_=%_res_:*exe"=% +call set _python_=%%_res_:%_end_%=%% +call %_python_% run-tests.py noenter set RET=%ERRORLEVEL% cd .. exit /b %RET% diff --git a/build.vc9/make.bat b/build.vc9/make.bat index 15c73ca3..db082d20 100644 --- a/build.vc9/make.bat +++ b/build.vc9/make.bat @@ -67,22 +67,16 @@ if errorlevel 1 ( exit /b 1 ) cd mpir-tests -python --version >nul 2>&1 +@echo off +for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (set _my_=%%f %%g) if not errorlevel 1 goto :got -if exist c:\Python26 ( - set "PATH=%PATH%;c:\Python26" - python --version >nul 2>&1 - if not errorlevel 1 goto :got -) -if exist c:\Python30 ( - set "PATH=%PATH%;c:\Python30" - python --version >nul 2>&1 - if not errorlevel 1 goto :got -) echo ERROR Could not find PYTHON exit /b 1 :got -python run-tests.py noenter +set _res_=%_my_:*REG_SZ=% +set _end_=%_res_:*exe"=% +call set _python_=%%_res_:%_end_%=%% +call %_python_% run-tests.py noenter set RET=%ERRORLEVEL% cd .. exit /b %RET%