From 0c9180eef0c7933d79907ffd46dd6eddc5843959 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Sat, 13 Jun 2015 11:15:00 -0700 Subject: [PATCH] Auto source vcvars (no need to use Developer Prompt anymore). --- README.md | 1 - xb.bat | 35 ++++++++++++++++++++++++++++++----- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b5e7d829e..b04c59640 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,6 @@ legally purchased devices and games and information made public on the internet Windows 8.1+ with Python 2.7 and Visual Studio 2015 installed: - # Launch the 'Developer Command Prompt for VS2015' command environment > git clone https://github.com/benvanik/xenia.git > cd xenia > xb setup diff --git a/xb.bat b/xb.bat index 2b26ad18b..41130d1cc 100644 --- a/xb.bat +++ b/xb.bat @@ -577,20 +577,45 @@ SET _RESULT=%ERRORLEVEL% GOTO :eof :check_msvc +SETLOCAL EnableDelayedExpansion 1>NUL 2>NUL CMD /c where devenv -SET _RESULT=%ERRORLEVEL% -IF %_RESULT% NEQ 0 GOTO :eof -SET _RESULT=1 +SET VS14_VCVARSALL="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" +SET VS15_VCVARSALL="C:\Program Files (x86)\Microsoft Visual Studio 15.0\VC\vcvarsall.bat" +IF %ERRORLEVEL% NEQ 0 ( + IF EXIST %VS15_VCVARSALL% ( + REM VS2015 + ECHO Sourcing Visual Studio settings from %VS15_VCVARSALL%... + CALL %VS15_VCVARSALL% amd64 + ) ELSE ( + IF EXIST %VS14_VCVARSALL% ( + REM VS2015 CTP/RC + ECHO Sourcing Visual Studio settings from %VS14_VCVARSALL%... + CALL %VS14_VCVARSALL% amd64 + ) + ) +) +1>NUL 2>NUL CMD /c where devenv +IF %ERRORLEVEL% NEQ 0 ( + REM Still no devenv! + ENDLOCAL & SET _RESULT=1 + GOTO :eof +) +SET HAVE_TOOLS=0 IF "%VS140COMNTOOLS%" NEQ "" ( IF EXIST "%VS140COMNTOOLS%" ( REM VS2015 CTP/RC - SET _RESULT=0 + SET HAVE_TOOLS=1 ) ) IF "%VS150COMNTOOLS%" NEQ "" ( IF EXIST "%VS150COMNTOOLS%" ( REM VS2015 - SET _RESULT=0 + SET HAVE_TOOLS=1 ) ) +IF %HAVE_TOOLS% NEQ 1 ( + ENDLOCAL & SET _RESULT=1 + GOTO :eof +) +ENDLOCAL & SET _RESULT=0 GOTO :eof