forked from pdinklag/JSFML
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwindows-find-vs.bat
24 lines (19 loc) · 1.22 KB
/
windows-find-vs.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
@echo off
REM This batch file is used by the Windows build targets to automatically find the location of the MS Visual Studio.
set UNKNOWN="?"
set RESULT=%UNKNOWN%
REM MSVC++ 2015 (14.0)
call:regQuery "HKLM\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\14.0" "ShellFolder" 2> NUL
if "%RESULT%"=="%UNKNOWN%" call:regQuery "HKLM\SOFTWARE\Microsoft\VisualStudio\14.0" "ShellFolder" 2> NUL
REM MSVC++ 2013 (12.0)
if "%RESULT%"=="%UNKNOWN%" call:regQuery "HKLM\SOFTWARE\Microsoft\VisualStudio\12.0\Setup\VS" "ProductDir" 2> NUL
if "%RESULT%"=="%UNKNOWN%" call:regQuery "HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0\Setup\VS" "ProductDir" 2> NUL
if "%RESULT%"=="%UNKNOWN%" call:regQuery "HKLM\SOFTWARE\Microsoft\VisualStudio\12.0\Setup\VC" "ProductDir" 2> NUL
if "%RESULT%"=="%UNKNOWN%" call:regQuery "HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0\Setup\VC" "ProductDir" 2> NUL
if "%RESULT%"=="%UNKNOWN%" call:regQuery "HKLM\SOFTWARE\Microsoft\VCExpress\12.0\Setup\VS" "ProductDir" 2> NUL
if "%RESULT%"=="%UNKNOWN%" call:regQuery "HKLM\SOFTWARE\Wow6432Node\Microsoft\VCExpress\12.0\Setup\VS" "ProductDir" 2> NUL
echo %RESULT%
goto:eof
:regQuery
for /F "tokens=2* delims= " %%A in ('reg query "%~1" /v %~2') do set RESULT=%%B
goto:eof