Skip to content

Commit

Permalink
install script now detects an existing VS environment.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sibras committed Apr 3, 2017
1 parent 124d44f commit b21c70d
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion install_script.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ REM Defined cript variables
set NASMDL=http://www.nasm.us/pub/nasm/releasebuilds
set NASMVERSION=2.12.02

REM Store current directory and ensure working directory is the location of current .bat
SET CALLDIR=%CD%
cd %~dp0

REM Initialise error check value
SET ERROR=0

REM Check what architecture we are installing on
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
echo Detected 64 bit system...
Expand All @@ -21,6 +28,25 @@ if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
goto Terminate
)

REM Check if already running in an environment with VS setup
if defined VCINSTALLDIR (
if defined VisualStudioVersion (
echo Existing Visual Studio environment detected...
if "%VisualStudioVersion%"=="15.0" (
set MSVC_VER=15
goto MSVCVarsDone
) else if "%VisualStudioVersion%"=="14.0" (
set MSVC_VER=14
goto MSVCVarsDone
) else if "%VisualStudioVersion%"=="12.0" (
set MSVC_VER=12
goto MSVCVarsDone
) else (
echo Unknown Visual Studio environment detected '%VisualStudioVersion%', Creating a new one...
)
)
)

REM First check for a environment variable to help locate the VS installation
if defined VS140COMNTOOLS (
if exist "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" (
Expand Down Expand Up @@ -161,6 +187,14 @@ if not exist "%VCINSTALLDIR%\nasm.exe" (
)
rd /S /Q "./TempNASMUnpack"
echo Finished Successfully
goto Exit

:Terminate
pause
SET ERROR=1

:Exit
cd %CALLDIR%
IF "%APPVEYOR%"=="" (
pause
)
exit /b %ERROR%

0 comments on commit b21c70d

Please sign in to comment.