set_vsprefix_envs.bat 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. @REM @file
  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.
  5. @REM
  6. @REM Copyright (c) 2016-2017, Intel Corporation. All rights reserved.<BR>
  7. @REM
  8. @REM This program and the accompanying materials are licensed and made available
  9. @REM under the terms and conditions of the BSD License which accompanies this
  10. @REM distribution. The full text of the license may be found at:
  11. @REM http://opensource.org/licenses/bsd-license.php
  12. @REM
  13. @REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
  14. @REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
  15. @REM IMPLIED.
  16. @REM
  17. @echo off
  18. pushd .
  19. if defined VS71COMNTOOLS (
  20. if not defined VS2003_PREFIX (
  21. set "VS2003_PREFIX=%VS71COMNTOOLS:~0,-14%"
  22. )
  23. )
  24. if defined VS80COMNTOOLS (
  25. if not defined VS2005_PREFIX (
  26. set "VS2005_PREFIX=%VS80COMNTOOLS:~0,-14%"
  27. )
  28. )
  29. if defined VS90COMNTOOLS (
  30. if not defined VS2008_PREFIX (
  31. set "VS2008_PREFIX=%VS90COMNTOOLS:~0,-14%"
  32. )
  33. if not defined WINSDK_PREFIX (
  34. set "WINSDK_PREFIX=c:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\"
  35. )
  36. if not defined WINSDKx86_PREFIX (
  37. set "WINSDKx86_PREFIX=c:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\bin\"
  38. )
  39. )
  40. if defined VS100COMNTOOLS (
  41. if not defined VS2010_PREFIX (
  42. set "VS2010_PREFIX=%VS100COMNTOOLS:~0,-14%"
  43. )
  44. if not defined WINSDK7_PREFIX (
  45. set "WINSDK7_PREFIX=c:\Program Files\Microsoft SDKs\Windows\v7.0A\Bin\"
  46. )
  47. if not defined WINSDK7x86_PREFIX (
  48. set "WINSDK7x86_PREFIX=c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\"
  49. )
  50. )
  51. if defined VS110COMNTOOLS (
  52. if not defined VS2012_PREFIX (
  53. set "VS2012_PREFIX=%VS110COMNTOOLS:~0,-14%"
  54. )
  55. if not defined WINSDK71_PREFIX (
  56. set "WINSDK71_PREFIX=c:\Program Files\Microsoft SDKs\Windows\v7.1A\Bin\"
  57. )
  58. if not defined WINSDK71x86_PREFIX (
  59. set "WINSDK71x86_PREFIX=c:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\"
  60. )
  61. )
  62. if defined VS120COMNTOOLS (
  63. if not defined VS2013_PREFIX (
  64. set "VS2013_PREFIX=%VS120COMNTOOLS:~0,-14%"
  65. )
  66. if not defined WINSDK8_PREFIX (
  67. set "WINSDK8_PREFIX=c:\Program Files\Windows Kits\8.0\bin\"
  68. )
  69. if not defined WINSDK8x86_PREFIX (
  70. set "WINSDK8x86_PREFIX=c:\Program Files (x86)\Windows Kits\8.0\bin\"
  71. )
  72. )
  73. if defined VS140COMNTOOLS (
  74. if not defined VS2015_PREFIX (
  75. set "VS2015_PREFIX=%VS140COMNTOOLS:~0,-14%"
  76. )
  77. if not defined WINSDK81_PREFIX (
  78. set "WINSDK81_PREFIX=c:\Program Files\Windows Kits\8.1\bin\"
  79. )
  80. if not defined WINSDK81x86_PREFIX (
  81. set "WINSDK81x86_PREFIX=c:\Program Files (x86)\Windows Kits\8.1\bin\"
  82. )
  83. )
  84. @REM set VS2017
  85. if not defined VS150COMNTOOLS (
  86. if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (
  87. for /f "usebackq tokens=1* delims=: " %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"`) do (
  88. if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
  89. )
  90. ) else if exist "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" (
  91. for /f "usebackq tokens=1* delims=: " %%i in (`"%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe"`) do (
  92. if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
  93. )
  94. ) else (
  95. goto SetWinDDK
  96. )
  97. )
  98. if defined VCToolsInstallDir (
  99. if not defined VS2017_PREFIX (
  100. set "VS2017_PREFIX=%VCToolsInstallDir%"
  101. )
  102. )
  103. if not defined WINSDK10_PREFIX (
  104. if defined WindowsSdkVerBinPath (
  105. set "WINSDK10_PREFIX=%WindowsSdkVerBinPath%"
  106. ) else if exist "%ProgramFiles(x86)%\Windows Kits\10\bin" (
  107. set "WINSDK10_PREFIX=%ProgramFiles(x86)%\Windows Kits\10\bin\"
  108. ) else if exist "%ProgramFiles%\Windows Kits\10\bin" (
  109. set "WINSDK10_PREFIX=%ProgramFiles%\Windows Kits\10\bin\"
  110. )
  111. )
  112. :SetWinDDK
  113. if not defined WINDDK3790_PREFIX (
  114. set WINDDK3790_PREFIX=C:\WINDDK\3790.1830\bin\
  115. )
  116. if not defined IASL_PREFIX (
  117. set IASL_PREFIX=C:\ASL\
  118. )
  119. popd