1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-09 17:44:48 +09:00
Satori/eng/disable_vsupdate.ps1
Juan Hoyos 82569704b1
Try to disable VSIX update service and collect VS update logs (#91708)
* Tweak invocations, disable service updates, detect vswhere missing
* Try disabling update early in build
* Only collect logs on official build on exit
2023-09-07 00:28:10 -07:00

23 lines
967 B
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