Update build.yml

This commit is contained in:
Jay Lee
2026-03-05 16:21:49 -05:00
committed by GitHub
parent d71bf9b6cb
commit 539b91a27e

View File

@@ -271,20 +271,30 @@ jobs:
$vswherePath = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" $vswherePath = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
$installerPath = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" $installerPath = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe"
$vsPath = & $vswherePath -latest -products * -property installationPath $vsPath = & $vswherePath -latest -products * -property installationPath
if (-not $vsPath) { Write-Error "Could not locate Visual Studio installation."; exit 1 }
if (-not $vsPath) {
Write-Host "Could not locate Visual Studio installation."
exit 1
}
$verBefore = & $vswherePath -latest -products * -property installationVersion $verBefore = & $vswherePath -latest -products * -property installationVersion
Write-Host "Found Visual Studio at: $vsPath (Version: $verBefore)" Write-Host "Found Visual Studio at: $vsPath (Version: $verBefore)"
Write-Host "Applying updates silently via local installer..." Write-Host "Applying updates silently via local installer..."
$arguments = "update --installPath `"$vsPath`" --quiet --norestart" $arguments = "update --installPath `"$vsPath`" --quiet --norestart"
$process = Start-Process -FilePath $installerPath -ArgumentList $arguments -Wait -PassThru $process = Start-Process -FilePath $installerPath -ArgumentList $arguments -Wait -PassThru
if ($process.ExitCode -eq 0 -or $process.ExitCode -eq 3010) { if ($process.ExitCode -eq 0 -or $process.ExitCode -eq 3010) {
$verAfter = & $vswherePath -latest -products * -property installationVersion $verAfter = & $vswherePath -latest -products * -property installationVersion
Write-Host "Visual Studio updated successfully. (Exit Code: $($process.ExitCode))" Write-Host "Visual Studio updated successfully. (Exit Code: $($process.ExitCode))"
Write-Host "Version upgraded from $verBefore to $verAfter" Write-Host "Version upgraded from $verBefore to $verAfter"
} else { } else {
Write-Error "Visual Studio update failed with exit code $($process.ExitCode)." # Changed to Write-Host so the script doesn't abort before dumping the log
Write-Host "Visual Studio update failed with exit code $($process.ExitCode)."
Write-Host "========== BEGIN INSTALLER ERROR LOG ==========" Write-Host "========== BEGIN INSTALLER ERROR LOG =========="
$logFile = Get-ChildItem -Path $env:TEMP -Filter "dd_setup_*.log" | Sort-Object LastWriteTime -Descending | Select-Object -First 1 $logFile = Get-ChildItem -Path $env:TEMP -Filter "dd_setup_*.log" | Sort-Object LastWriteTime -Descending | Select-Object -First 1
if ($logFile) { if ($logFile) {
Write-Host "Dumping error details from: $($logFile.FullName)" Write-Host "Dumping error details from: $($logFile.FullName)"
Write-Host "-----------------------------------------------" Write-Host "-----------------------------------------------"
@@ -292,6 +302,7 @@ jobs:
} else { } else {
Write-Host "No dd_setup log file could be found in $env:TEMP." Write-Host "No dd_setup log file could be found in $env:TEMP."
} }
Write-Host "=========== END INSTALLER ERROR LOG ===========" Write-Host "=========== END INSTALLER ERROR LOG ==========="
exit $process.ExitCode exit $process.ExitCode
} }