You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

23 lines
1.1 KiB

New-Item "temp" -ItemType "directory" -Force
$client = New-Object System.Net.WebClient
$client.DownloadFile("https://aka.ms/vs/16/release/channel", "temp\visualstudio.release.chman")
$client.DownloadFile("https://aka.ms/vs/16/release/vs_buildtools.exe", "temp\vs_buildtools.exe")
$args = @("--passive", "--wait", "--norestart",
"--channelUri", ($pwd.path + "\temp\visualstudio.release.chman"),
"--installChannelUri", ($pwd.path + "\temp\visualstudio.release.chman"),
"--add", "Microsoft.VisualStudio.Workload.VCTools", "--includeRecommended",
"--installPath", "C:\msvc")
Start-Process "temp\vs_buildtools.exe" -ArgumentList $args -Wait
$path = [System.Environment]::GetEnvironmentVariable("PATH", "User")
$cmake = "C:\msvc\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;"
if(-not $path.Contains($cmake)){
[Environment]::SetEnvironmentVariable("PATH", $path + $cmake, "User")
}
$path = [System.Environment]::GetEnvironmentVariable("PATH", "User")
$msbuild = "C:\msvc\MSBuild\Current\Bin;"
if(-not $path.Contains($msbuild)){
[Environment]::SetEnvironmentVariable("PATH", $path + $msbuild, "User")
}