File tree Expand file tree Collapse file tree 1 file changed +35
-1
lines changed
Expand file tree Collapse file tree 1 file changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,13 @@ REM Defined cript variables
44set NASMDL = http://www.nasm.us/pub/nasm/releasebuilds
55set NASMVERSION = 2.12.02
66
7+ REM Store current directory and ensure working directory is the location of current .bat
8+ SET CALLDIR = %CD%
9+ cd %~dp0
10+
11+ REM Initialise error check value
12+ SET ERROR = 0
13+
714REM Check what architecture we are installing on
815if " %PROCESSOR_ARCHITECTURE% " == " AMD64" (
916 echo Detected 64 bit system...
@@ -21,6 +28,25 @@ if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
2128 goto Terminate
2229)
2330
31+ REM Check if already running in an environment with VS setup
32+ if defined VCINSTALLDIR (
33+ if defined VisualStudioVersion (
34+ echo Existing Visual Studio environment detected...
35+ if " %VisualStudioVersion% " == " 15.0" (
36+ set MSVC_VER = 15
37+ goto MSVCVarsDone
38+ ) else if " %VisualStudioVersion% " == " 14.0" (
39+ set MSVC_VER = 14
40+ goto MSVCVarsDone
41+ ) else if " %VisualStudioVersion% " == " 12.0" (
42+ set MSVC_VER = 12
43+ goto MSVCVarsDone
44+ ) else (
45+ echo Unknown Visual Studio environment detected '%VisualStudioVersion% ', Creating a new one...
46+ )
47+ )
48+ )
49+
2450REM First check for a environment variable to help locate the VS installation
2551if defined VS140COMNTOOLS (
2652 if exist " %VS140COMNTOOLS% \..\..\VC\vcvarsall.bat" (
@@ -161,6 +187,14 @@ if not exist "%VCINSTALLDIR%\nasm.exe" (
161187)
162188rd /S /Q " ./TempNASMUnpack"
163189echo Finished Successfully
190+ goto Exit
164191
165192:Terminate
166- pause
193+ SET ERROR = 1
194+
195+ :Exit
196+ cd %CALLDIR%
197+ IF " %APPVEYOR% " == " " (
198+ pause
199+ )
200+ exit /b %ERROR%
You can’t perform that action at this time.
0 commit comments