Advertisement
Guest User

Untitled

a guest
Feb 7th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 3.26 KB | None | 0 0
  1.  
  2.  
  3. @echo off
  4.  
  5. REM VC command prompt depends on env. variable installed during VS. This causes VC command prompt to break for C++ Build SKU.
  6. REM So if VS is not installed and C++ Build SKU is installed, set appropriate environment for C++ Build SKU by calling into it's batch file.
  7. REM C++ Build SKU supports only desktop development environment.
  8.  
  9. if exist "%~dp0..\common7\IDE\devenv.exe" goto setup_VS
  10. if not exist "%~dp0..\common7\IDE\wdexpress.exe" goto setup_buildsku
  11.  
  12. :setup_VS
  13.  
  14. if "%1" == "" goto x86
  15. if "%2" == "" goto check_platform
  16. setlocal
  17. set _Argument2=%2
  18. if not "%2"=="store" if not "%2"=="8.1" if not "%_Argument2:~0,3%"=="10."  goto usage
  19. endlocal
  20.  
  21. :check_platform
  22. if /i %1 == x86       goto x86
  23. if /i %1 == amd64     goto amd64
  24. if /i %1 == x64       goto amd64
  25. if /i %1 == arm       goto arm
  26. if /i %1 == x86_arm   goto x86_arm
  27. if /i %1 == x86_amd64 goto x86_amd64
  28. if /i %1 == amd64_x86 goto amd64_x86
  29. if /i %1 == amd64_arm goto amd64_arm
  30. goto usage
  31.  
  32. :x86
  33. if not exist "%~dp0bin\vcvars32.bat" goto missing
  34. call "%~dp0bin\vcvars32.bat" %2 %3
  35. goto :SetVisualStudioVersion
  36.  
  37. :amd64
  38. if not exist "%~dp0bin\amd64\vcvars64.bat" goto missing
  39. call "%~dp0bin\amd64\vcvars64.bat" %2 %3
  40. goto :SetVisualStudioVersion
  41.  
  42. :arm
  43. if not exist "%~dp0bin\arm\vcvarsarm.bat" goto missing
  44. call "%~dp0bin\arm\vcvarsarm.bat" %2 %3
  45. goto :SetVisualStudioVersion
  46.  
  47. :x86_amd64
  48. if not exist "%~dp0bin\x86_amd64\vcvarsx86_amd64.bat" goto missing
  49. call "%~dp0bin\x86_amd64\vcvarsx86_amd64.bat" %2 %3
  50. goto :SetVisualStudioVersion
  51.  
  52. :x86_arm
  53. if not exist "%~dp0bin\x86_arm\vcvarsx86_arm.bat" goto missing
  54. call "%~dp0bin\x86_arm\vcvarsx86_arm.bat" %2 %3
  55. goto :SetVisualStudioVersion
  56.  
  57. :amd64_x86
  58. if not exist "%~dp0bin\amd64_x86\vcvarsamd64_x86.bat" goto missing
  59. call "%~dp0bin\amd64_x86\vcvarsamd64_x86.bat" %2 %3
  60. goto :SetVisualStudioVersion
  61.  
  62. :amd64_arm
  63. if not exist "%~dp0bin\amd64_arm\vcvarsamd64_arm.bat" goto missing
  64. call "%~dp0bin\amd64_arm\vcvarsamd64_arm.bat" %2 %3
  65. goto :SetVisualStudioVersion
  66.  
  67. :SetVisualStudioVersion
  68. set VisualStudioVersion=14.0
  69. goto :eof
  70.  
  71. :setup_buildsku
  72. if not exist "%~dp0..\..\Microsoft Visual C++ Build Tools\vcbuildtools.bat" goto usage
  73. set CurrentDir=%CD%
  74. call "%~dp0..\..\Microsoft Visual C++ Build Tools\vcbuildtools.bat" %1 %2
  75. cd /d %CurrentDir%
  76. goto :eof
  77.  
  78. :usage
  79. echo Error in script usage. The correct usage is:
  80. echo     %0 [option]
  81. echo   or
  82. echo     %0 [option] store
  83. echo   or
  84. echo     %0 [option] [version number]
  85. echo   or
  86. echo     %0 [option] store [version number]
  87. echo where [option] is: x86 ^| amd64 ^| arm ^| x86_amd64 ^| x86_arm ^| amd64_x86 ^| amd64_arm
  88. echo where [version number] is either the full Windows 10 SDK version number or "8.1" to use the windows 8.1 SDK
  89. echo :
  90. echo The store parameter sets environment variables to support
  91. echo   store (rather than desktop) development.
  92. echo :
  93. echo For example:
  94. echo     %0 x86_amd64
  95. echo     %0 x86_arm store
  96. echo     %0 x86_amd64 10.0.10240.0
  97. echo     %0 x86_arm store 10.0.10240.0
  98. echo     %0 x64 8.1
  99. echo     %0 x64 store 8.1
  100. echo :
  101. echo Please make sure either Visual Studio or C++ Build SKU is installed.
  102. goto :eof
  103.  
  104. :missing
  105. echo The specified configuration type is missing.  The tools for the
  106. echo configuration might not be installed.
  107. goto :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement