Skip to content

Commit

Permalink
[ci] Do not try to modify classic VSIX install (#8518)
Browse files Browse the repository at this point in the history
We are no longer regularly installing arbitrary preview versions of the
classic XA VSIX on our Windows pool.  We can save some windows build
time by not attempting to modify VS.
  • Loading branch information
pjcollins authored Nov 20, 2023
1 parent 8f33823 commit b869d27
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions build-tools/automation/yaml-templates/build-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,31 +45,6 @@ stages:
parameters:
remove_dotnet: true

# Downgrade the XA .vsix installed into the instance of VS that we are building with so that we don't restore/build against a test version.
# The VS installer will attempt to resume any failed or partial installation before trying to downgrade Xamarin.Android.
# VSIXInstaller.exe will exit non-zero when the downgrade attempt is a no-op, so we will allow this step to fail silently.
- powershell: |
$vsWhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
& "$vsWhere" -all -prerelease -latest | Out-Default
$isLatestVSLaunchable = & "$vsWhere" -all -prerelease -latest -property isLaunchable
if ($isLatestVSLaunchable -eq 0) {
$vsPath = & "$vsWhere" -all -prerelease -latest -property installationPath
Write-Host "Attempting to repair VS instance:" $vsPath
$vsInstaller = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vs_installer.exe"
& "$vsInstaller" resume --installPath $vsPath --quiet --norestart | Out-Default
Write-Host "vs_installer.exe resume attempt complete"
}
$vsixInstaller = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service\VSIXInstaller.exe"
$ts = Get-Date -Format FileDateTimeUniversal
$log = "xavsixdowngrade-$ts.log"
$process = Start-Process -NoNewWindow -FilePath $vsixInstaller -ArgumentList "/downgrade:Xamarin.Android.Sdk /admin /quiet /logFile:$log" -Wait -PassThru -RedirectStandardError "err.txt"
Get-Content "err.txt" | Write-Host
Get-Content "${env:TEMP}\$log" | Write-Host
Write-Host "VSInstaller.exe exited with code:" $process.ExitCode
Remove-Item "${env:TEMP}\$log"
displayName: downgrade XA to stable
ignoreLASTEXITCODE: true
- task: DotNetCoreCLI@2
displayName: Prepare Solution
inputs:
Expand Down

0 comments on commit b869d27

Please sign in to comment.