次の方法で共有


Set defaults for enterprise deployments of Visual Studio

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

You can set registry policies that affect the deployment and update behavior of Visual Studio. These policies are global on the client machine and affect the following:

  • Where some packages shared with other versions or instances are installed.
  • Where and whether packages are cached.
  • If administrator updates should be enabled and how they should be applied.
  • Which update channels are available and how they're presented to the client.
  • How notifications appear or don't appear.

You can set these policies by using command-line options on the client machine, by setting registry values directly on the client machine, or by distributing them using Group Policy across an organization.

Registry keys

There are several locations where you can set enterprise defaults to enable their control either through Group Policy or directly in the registry. Visual Studio looks sequentially to see if any enterprise policies have been set; as soon as a policy value is discovered in the order below, the remaining keys are ignored.

  1. HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\VisualStudio\Setup
  2. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\Setup
  3. HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\Setup (on 64-bit operating systems)

Some registry values are set automatically the first time they are used if not set already. This practice ensures that subsequent installs use the same values. These values are stored in the second registry key, HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\Setup.

You can set the following registry values:

Controlling installation and download behavior

The registry settings in this section control how and where the Visual Studio product is downloaded onto the client machine.

Name Type Default Description
CachePath REG_SZ or REG_EXPAND_SZ %ProgramData%
\Microsoft
\VisualStudio
\Packages
The directory where package manifests and, optionally, payloads are stored. For more information, see Disable or move the package cache page.
KeepDownloadedPayloads REG_DWORD 1 Keep package payloads even after they are installed. You can change the value anytime. Disabling the policy removes any cached package payloads for the instance you repair or modify. For more information, see Disable or move the package cache page.
SharedInstallationPath REG_SZ or REG_EXPAND_SZ %ProgramFiles(x86)%
\Microsoft Visual Studio
\Shared
The directory where some packages shared across versions of instances of Visual Studio are installed. You can change the value anytime, but it will only affect future installs. Any products already installed to the old location must not be moved or they might not function correctly.
BackgroundDownloadDisabled REG_DWORD 0 Prevent setup from downloading updates automatically for all installed Visual Studio products. You can change the value anytime.

Important

If you change the CachePath registry policy after any installations, you must move the existing package cache to the new location and make sure it's secured so that SYSTEM and Administrators have Full Control and that Everyone has Read access. Failure to move the existing cache or securing it might cause problems with future installs.

Controlling Administrator Updates

The registry settings in this section control if and how administrator updates are applied to the client machine.

Name Type Default Description
AdministratorUpdatesEnabled REG_DWORD 0 Allows administrator updates to be applied to the client computer. If this value is missing or is set to 0, administrator updates will be blocked. This value is for administrative use. For more information, see Enabling Administrator Updates.
AdministratorUpdatesOptOut REG_DWORD 0 Indicates that the user does not want to receive administrator updates to Visual Studio. The absence of the registry value, or a set value of 0, means that the Visual Studio user wants to receive administrator updates to Visual Studio. This is for developer user (if they have admin permissions on the client machine). For more information, see Applying administrator updates.
UpdateConfigurationFile REG_SZ or REG_EXPAND_SZ %ProgramData%
\Microsoft
\VisualStudio
\updates.config
The file path for configuring Administrative Updates. For more information, see Methods for configuring an administrator update.

Controlling notifications in the Visual Studio IDE

As described earlier, Visual Studio checks the location from which it has been installed, such as a network share or the internet, to see whether any updates are available. When an update is available, Visual Studio notifies the user with a notification flag in the top right-hand corner of the window.

Notification flag for updates

You can disable the notifications if you don't want end users to be notified of updates. (For example, you might want to disable notifications if you deliver updates through a central software distribution mechanism.)

Because Visual Studio 2017 stores registry entries in a private registry, you can't directly edit the registry in the typical way. However, Visual Studio includes a vsregedit.exe utility that you can use to change Visual Studio settings. You can turn off notifications with the following command:

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

You can turn notifications back on with the following command:

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

To get back to default behavior, you can also delete the value with the following command:

vsregedit.exe remove "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise" HKCU ExtensionManager AutomaticallyCheckForUpdates2Override

After you run the command to change Visual Studio settings, start Visual Studio. Any already-running instances of Visual Studio won't change behavior until Visual Studio is shut down and restarted. As another option, you can restart the computer to make sure the setting takes effect.

You can confirm the setting with the following command:

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

If the value doesn’t exist (this is the condition by default), the previous command will indicate it failed to read the value. If you set the value, then the previous command will reflect the value in the Visual Studio configuration (it will indicate either 0 or 1, or whatever value it is set to – only 0 or 1 are expected).

(Make sure to replace the directory to match the installed instance that you want to edit.)

Tip

Use vswhere.exe to find a specific instance of Visual Studio on a client workstation.

Support or troubleshooting

Sometimes, things can go wrong. If your Visual Studio installation fails, see Troubleshoot Visual Studio installation and upgrade issues for step-by-step guidance.

Here are a few more support options:

  • We also offer an installation chat (English only) support option for installation-related issues.
  • Report product issues to us via the Report a Problem tool that appears both in the Visual Studio Installer and in the Visual Studio IDE. If you're an IT Administrator and don't have Visual Studio installed, you can submit IT Admin feedback here.
  • Suggest a feature, track product issues, and find answers in the Visual Studio Developer Community.

See also