2 @REM This stand
-alone program is typically called by the toolsetup.bat file
,
3 @REM however it may be executed directly from the BaseTools project folder
4 @REM
if the file is
not executed within a WORKSPACE\BaseTools folder.
6 @REM Copyright
(c
) 2016-2017, Intel Corporation. All rights reserved.
<BR
>
8 @REM SPDX
-License
-Identifier
: BSD
-2-Clause
-Patent
21 if /I
"%1"=="VS2017" goto SetVS2017
22 if /I
"%1"=="VS2015" goto SetVS2015
23 if /I
"%1"=="VS2013" goto SetVS2013
24 if /I
"%1"=="VS2012" goto SetVS2012
26 if defined VS71COMNTOOLS
(
27 if not defined VS2003_PREFIX
(
28 set "VS2003_PREFIX=%VS71COMNTOOLS:~0,-14%"
32 if defined VS80COMNTOOLS
(
33 if not defined VS2005_PREFIX
(
34 set "VS2005_PREFIX=%VS80COMNTOOLS:~0,-14%"
38 if defined VS90COMNTOOLS
(
39 if not defined VS2008_PREFIX
(
40 set "VS2008_PREFIX=%VS90COMNTOOLS:~0,-14%"
42 if not defined WINSDK_PREFIX
(
43 set "WINSDK_PREFIX=c:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\"
45 if not defined WINSDKx86_PREFIX (
46 set "WINSDKx86_PREFIX
=c
:\Program
Files (x86
)\Microsoft SDKs\Windows
\v6.0A
\bin
\"
50 if defined VS100COMNTOOLS
(
51 if not defined VS2010_PREFIX
(
52 set "VS2010_PREFIX=%VS100COMNTOOLS:~0,-14%"
54 if not defined WINSDK7_PREFIX
(
55 set "WINSDK7_PREFIX=c:\Program Files\Microsoft SDKs\Windows\v7.0A\Bin\"
57 if not defined WINSDK7x86_PREFIX (
58 set "WINSDK7x86_PREFIX
=c
:\Program
Files (x86
)\Microsoft SDKs\Windows
\v7.0A\Bin
\"
63 if defined VS110COMNTOOLS
(
64 if not defined VS2012_PREFIX
(
65 set "VS2012_PREFIX=%VS110COMNTOOLS:~0,-14%"
67 if not defined WINSDK71_PREFIX
(
68 set "WINSDK71_PREFIX=c:\Program Files\Microsoft SDKs\Windows\v7.1A\Bin\"
70 if not defined WINSDK71x86_PREFIX (
71 set "WINSDK71x86_PREFIX
=c
:\Program
Files (x86
)\Microsoft SDKs\Windows
\v7.1A\Bin
\"
74 if /I
"%1"=="VS2012" goto ToolNotInstall
76 if /I
"%1"=="VS2012" goto SetWinDDK
79 if defined VS120COMNTOOLS
(
80 if not defined VS2013_PREFIX
(
81 set "VS2013_PREFIX=%VS120COMNTOOLS:~0,-14%"
83 if not defined WINSDK8_PREFIX
(
84 set "WINSDK8_PREFIX=c:\Program Files\Windows Kits\8.0\bin\"
86 if not defined WINSDK8x86_PREFIX (
87 set "WINSDK8x86_PREFIX
=c
:\Program
Files (x86
)\Windows Kits\
8.0\bin
\"
90 if /I
"%1"=="VS2013" goto ToolNotInstall
92 if /I
"%1"=="VS2013" goto SetWinDDK
95 if defined VS140COMNTOOLS
(
96 if not defined VS2015_PREFIX
(
97 set "VS2015_PREFIX=%VS140COMNTOOLS:~0,-14%"
99 if not defined WINSDK81_PREFIX
(
100 set "WINSDK81_PREFIX=c:\Program Files\Windows Kits\8.1\bin\"
102 if not defined WINSDK81x86_PREFIX (
103 set "WINSDK81x86_PREFIX
=c
:\Program
Files (x86
)\Windows Kits\
8.1\bin
\"
106 if /I
"%1"=="VS2015" goto ToolNotInstall
108 if /I
"%1"=="VS2015" goto SetWinDDK
111 if not defined VS150COMNTOOLS
(
112 if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (
113 if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\BuildTools" (
114 for /f
"usebackq tokens=1* delims=: " %%i in
(`
"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools`
) do (
115 if /i
"%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
118 for /f
"usebackq tokens=1* delims=: " %%i in
(`
"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"`
) do (
119 if /i
"%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
122 ) else if exist "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" (
123 if exist "%ProgramFiles%\Microsoft Visual Studio\2017\BuildTools" (
124 for /f
"usebackq tokens=1* delims=: " %%i in
(`
"%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools`
) do (
125 if /i
"%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
128 for /f
"usebackq tokens=1* delims=: " %%i in
(`
"%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe"`
) do (
129 if /i
"%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
133 if /I
"%1"=="VS2017" goto ToolNotInstall
138 if defined VCToolsInstallDir
(
139 if not defined VS2017_PREFIX
(
140 set "VS2017_PREFIX=%VCToolsInstallDir%"
143 if not defined WINSDK10_PREFIX
(
144 if defined WindowsSdkVerBinPath
(
145 set "WINSDK10_PREFIX=%WindowsSdkVerBinPath%"
146 ) else if exist "%ProgramFiles(x86)%\Windows Kits\10\bin" (
147 set "WINSDK10_PREFIX=%ProgramFiles(x86)%\Windows Kits\10\bin\"
148 ) else if exist "%ProgramFiles%\Windows Kits\
10\bin
" (
149 set "WINSDK10_PREFIX
=%ProgramFiles%\Windows Kits\
10\bin
\"
154 if not defined WINDDK3790_PREFIX
(
155 set WINDDK3790_PREFIX
=C
:\WINDDK
\3790.1830
\bin\
158 if not defined IASL_PREFIX
(
159 set IASL_PREFIX
=C
:\ASL\