-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try to disable VSIX update service or failfast (#92028)
- Loading branch information
Showing
4 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
eng/pipelines/common/templates/disable-vsupdate-or-failfast.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# This script tries to disable VSIXAutoUpdate. In case an update is seen as already running, | ||
# it will exit with an error. | ||
steps: | ||
- powershell: | | ||
schtasks /change /tn "\Microsoft\VisualStudio\VSIX Auto Update" /disable | ||
$vswhere = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" | ||
if (-not (Test-Path -Path "$vswhere" -PathType Leaf)) | ||
{ | ||
Write-Error "Couldn't locate vswhere at $vswhere" | ||
exit 1 | ||
} | ||
$vsdir = &"$vswhere" -latest -prerelease -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath | ||
$vsregedit = "$vsdir\Common7\IDE\VsRegEdit.exe" | ||
if (-not (Test-Path -Path "$vsregedit" )) | ||
{ | ||
Write-Error "VSWhere returned path: $vsdir, but regedit $vsregedit doesn't exist." | ||
exit 1 | ||
} | ||
Write-Output "VSWhere returned path: $vsdir, using regedit $vsregedit" | ||
Write-Output "Disabling updates through VS Registry:" | ||
&"$vsdir\Common7\IDE\VsRegEdit.exe" set local HKCU ExtensionManager AutomaticallyCheckForUpdates2Override dword 0 | ||
&"$vsdir\Common7\IDE\VsRegEdit.exe" read local HKCU ExtensionManager AutomaticallyCheckForUpdates2Override dword | ||
$processes = Get-Process -Name VSIXAutoUpdate -ErrorAction SilentlyContinue | ||
if ($processes -ne $null -and $processes.Count -gt 0) | ||
{ | ||
Write-Error "VSIXAutoUpdate has already spawned. Failfast to allow retry" | ||
exit 1 | ||
} | ||
displayName: Disable VSIX updates or fail-fast | ||
condition: always() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters