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