Following How to install Visual Studio Build Tools unattended? I installed Visual Studio Build Tools with:
# Visual Studio build tools
Write-Host "Installing visual studio build tools..." -ForegroundColor Cyan
cd $env:USERPROFILE
$exePath = "$env:TEMP\vs.exe"
Invoke-WebRequest -Uri https://aka.ms/vs/17/release/vs_BuildTools.exe -UseBasicParsing -OutFile $exePath
Write-Host "layout..." -ForegroundColor Cyan
Start-Process $exePath -ArgumentList "--layout .\vs_BuildTools --quiet" -Wait
cd vs_BuildTools
Write-Host "actual installation..." -ForegroundColor Cyan
Start-Process vs_setup.exe -ArgumentList "--installPath $env:USERPROFILE\vs_BuildTools2022 --nocache --wait --noUpdateInstaller --noWeb --allWorkloads --includeRecommended --includeOptional --quiet --norestart" -Wait
You can see that I installed locally so I don't need admin permissions.
When I try to install something with vcpkg, however, it can't find my Visual Studio Build Tools installation:
Write-Host "Installing vcpkg..." -ForegroundColor Cyan
git clone https://github.com/Microsoft/vcpkg.git C:\src\vcpkg
C:\src\vcpkg\bootstrap-vcpkg.bat
C:\src\vcpkg\vcpkg.exe --version
C:\src\vcpkg\vcpkg.exe install gtest
gives
error: in triplet x64-windows: Unable to find a valid Visual Studio instance
Is there some variable that I can set so vcpkg
can find the Visual Studio Build Tools local installation?