1*7330f729Sjoerg@echo off 2*7330f729Sjoerg 3*7330f729Sjoergecho Installing MSVC integration... 4*7330f729Sjoergset SUCCESS=0 5*7330f729Sjoerg 6*7330f729SjoergREM In general this script should not be used except for development and testing 7*7330f729SjoergREM purposes. The proper way to install is via the VSIX, and the proper way to 8*7330f729SjoergREM uninstall is through the Visual Studio extension manager. 9*7330f729Sjoerg 10*7330f729SjoergREM Change to the directory of this batch file. 11*7330f729Sjoergcd /d %~dp0 12*7330f729Sjoerg 13*7330f729SjoergREM Older versions of VS would look for these files in the Program Files\MSBuild directory 14*7330f729SjoergREM but with VS2017 it seems to look for these directly in the Visual Studio instance. 15*7330f729SjoergREM This means we'll need to do a little extra work to properly detect all the various 16*7330f729SjoergREM instances, but in reality we can probably sidestep all of this by just wrapping this 17*7330f729SjoergREM in a vsix and calling it a day, as that should handle everything for us. 18*7330f729SjoergSET VCTargets=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets 19*7330f729Sjoerg 20*7330f729SjoergECHO Installing Common Files 21*7330f729Sjoergcopy LLVM.Cpp.Common.props "%VCTargets%" 22*7330f729SjoergIF NOT %ERRORLEVEL% == 0 GOTO FAILED 23*7330f729Sjoergcopy LLVM.Cpp.Common.targets "%VCTargets%" 24*7330f729SjoergIF NOT %ERRORLEVEL% == 0 GOTO FAILED 25*7330f729Sjoerg 26*7330f729SjoergECHO Installing x64 Platform Toolset 27*7330f729SjoergSET PlatformToolsets=%VCTargets%\Platforms\x64\PlatformToolsets 28*7330f729SjoergIF NOT EXIST "%PlatformToolsets%\llvm" mkdir "%PlatformToolsets%\llvm" 29*7330f729SjoergIF NOT %ERRORLEVEL% == 0 GOTO FAILED 30*7330f729Sjoergcopy PlatformX64\Toolset.props "%PlatformToolsets%\llvm" 31*7330f729SjoergIF NOT %ERRORLEVEL% == 0 GOTO FAILED 32*7330f729Sjoergcopy PlatformX64\Toolset.targets "%PlatformToolsets%\llvm" 33*7330f729SjoergIF NOT %ERRORLEVEL% == 0 GOTO FAILED 34*7330f729Sjoerg 35*7330f729SjoergECHO Installing Win32 Platform Toolset 36*7330f729SjoergSET PlatformToolsets=%VCTargets%\Platforms\Win32\PlatformToolsets 37*7330f729SjoergIF NOT EXIST "%PlatformToolsets%\llvm" mkdir "%PlatformToolsets%\llvm" 38*7330f729SjoergIF NOT %ERRORLEVEL% == 0 GOTO FAILED 39*7330f729Sjoergcopy PlatformX86\Toolset.props "%PlatformToolsets%\llvm" 40*7330f729SjoergIF NOT %ERRORLEVEL% == 0 GOTO FAILED 41*7330f729Sjoergcopy PlatformX86\Toolset.targets "%PlatformToolsets%\llvm" 42*7330f729SjoergIF NOT %ERRORLEVEL% == 0 GOTO FAILED 43*7330f729Sjoerg 44*7330f729SjoergECHO Installing C++ Settings UI 45*7330f729Sjoergcopy llvm-general.xml "%VCTargets%\1033" 46*7330f729SjoergIF NOT %ERRORLEVEL% == 0 GOTO FAILED 47*7330f729Sjoerg 48*7330f729Sjoerg:DONE 49*7330f729Sjoergecho Done! 50*7330f729Sjoerggoto END 51*7330f729Sjoerg 52*7330f729Sjoerg:FAILED 53*7330f729Sjoergecho MSVC integration install failed. 54*7330f729Sjoergpause 55*7330f729Sjoerggoto END 56*7330f729Sjoerg 57*7330f729Sjoerg:END 58