]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/get_vsvars.bat
Maintainers.txt: Remove Network maintainers for MdeModulePkg/Universal/Network
[mirror_edk2.git] / BaseTools / get_vsvars.bat
1 @REM @file
2 @REM Windows batch file to find the Visual Studio set up script
3 @REM
4 @REM Copyright (c) 2013-2014, ARM Limited. All rights reserved.
5
6 @REM SPDX-License-Identifier: BSD-2-Clause-Patent
7 @REM
8
9
10 @echo off
11 goto :main
12
13 :set_vsvars
14 for /f "usebackq tokens=1* delims=: " %%i in (`%*`) do (
15 if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
16 )
17 goto :EOF
18
19 :read_vsvars
20 @rem Do nothing if already found, otherwise call vsvars32.bat if there
21 if defined VCINSTALLDIR goto :EOF
22 set GET_VSVARS_BAT_CHECK_DIR=%*
23 set GET_VSVARS_BAT_CHECK_DIR=%GET_VSVARS_BAT_CHECK_DIR:"=%
24 if exist "%GET_VSVARS_BAT_CHECK_DIR%\vsvars32.bat" call "%GET_VSVARS_BAT_CHECK_DIR%\vsvars32.bat"
25 :vsvars_done
26 goto :EOF
27
28
29 REM NOTE: This file will find the most recent Visual Studio installation
30 REM apparent from the environment.
31 REM To use an older version, modify your environment set up.
32 REM (Or invoke the relevant vsvars32 file beforehand).
33
34 :main
35 if defined VCINSTALLDIR goto :done
36 if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" call :set_vsvars "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
37 if exist "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" call :set_vsvars "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe"
38 if defined VS140COMNTOOLS call :read_vsvars "%VS140COMNTOOLS%"
39 if defined VS120COMNTOOLS call :read_vsvars "%VS120COMNTOOLS%"
40 if defined VS110COMNTOOLS call :read_vsvars "%VS110COMNTOOLS%"
41 if defined VS100COMNTOOLS call :read_vsvars "%VS100COMNTOOLS%"
42 if defined VS90COMNTOOLS call :read_vsvars "%VS90COMNTOOLS%"
43 if defined VS80COMNTOOLS call :read_vsvars "%VS80COMNTOOLS%"
44 if defined VS71COMNTOOLS call :read_vsvars "%VS71COMNTOOLS%"
45
46 :done
47 set GET_VSVARS_BAT_CHECK_DIR=