How to disable Visual Studio extension automatic updates in an unattended mode?
Asked Answered
P

3

17

I can disable automatic extension update for a particular extension via the Extensions and Updates manager in Visual Studio. But what should I do when I want to disable automatic updates for extension FOO on all computers of my team in an unattended mode?

I want an option to use AD GPO or modify Windows Registry to make a specific Visual Studio extension stop receiving automatic updates. Is this even possible now?

Percolation answered 24/10, 2018 at 12:40 Comment(0)
G
8

I stop VS from checking updates altogether.

For VS2019:

vsregedit.exe set "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise" HKCU ExtensionManager AutomaticallyCheckForUpdates2Override dword 0

For VS2017:

vsregedit.exe set "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise" HKCU ExtensionManager AutomaticallyCheckForUpdates2Override dword 0
Greenaway answered 10/7, 2019 at 15:28 Comment(0)
E
2

I've faced a similar issue today. I haven't got a fully automated solution since I haven't need it, but I think I've collected enough information so you'll be able to correctly prepare a small application that can do it.

Starting at Visual Studio 2017, the configuration is no longer stored in the central registry but in a private file, located at %LOCALAPPDATA%\Microsoft\VisualStudio\15.0_ <somekind_of_id>\privateregistry.bin. I'm not sure how to determine somekind_of_id (in my case it is 3eeca950, for simplicity I've kept such value in all the paths, just replace with yours). This file is locked by Visual Studio, so it must be closed before trying to modify it (it takes VS some seconds to free the lock).

This file can be imported into an application hive using RegLoadAppKeyA. This function will create an HKEY that can be used together RegSetKeyValueA to modify the values you need.

The key you are interested in is Software\Microsoft\VisualStudio\15.0_3eeca950\ExtensionManager\ExtensionAutoUpdateEnrollment. Under it are listed all the extensions installed, each one as a DWORD value, where a 0 value means no automatic update, 1 means that it is automatically updated.

Each extension value is named after the ID of the extension, together the current version. For example WixToolset.VisualStudioExtension.Dev15,0.9.21.62588.

You can check this ID in the manifest.json file of the extension package (you can open the .vsix files using 7-Zip for example). If you don't have the .vsix file, can find the extension data under %LOCALAPPDATA%\Microsoft\VisualStudio\15.0_3eeca950\Extensions\.

Esotropia answered 21/2, 2019 at 16:32 Comment(0)
R
0

To stop the Auto-Updates from Visual Studio Marketplace extensions to TFS On-Prem Servers

Run below command in 1Tfs_configuration1

update [Tfs_Configuration].[dbo].[tbl_JobDefinition]
set EnabledState = 2 
where PartitionId > 0 and JobId = 'A8F60BD0-BCBA-4343-82B3-FD6B40D657D8' 

It should stop the auto updates for the extension with JobId A8F60BD0-BCBA-4343-82B3-FD6B40D657D8.

Rae answered 21/10, 2019 at 14:22 Comment(2)
Does this stop auto-updates for all extensions or for a particular one only?Percolation
This script will stop auto update for all extensionsRae

© 2022 - 2024 — McMap. All rights reserved.