November 8th, 2017

Set both x86 and x64 registry views for custom setup policy

Heath Stewart
Principal Software Engineer

I previously blogged about the documentation to move the Visual Studio 2017 package cache by changing the CachePath policy. Originally this was done only with changes under the HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\VisualStudio\Setup registry key, which is defined under the usual location for server and application policies. This registry key is shared (formerly reflected) across both 32- and 64-bit views of the registry.

We recently discovered an issue, however, that if you’re unable to write to that location (some corporate networks prevent even administrative users from writing to that key or otherwise subsequently overwrite any changes) and instead you change HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\Setup 32-bit applications may not work.

Symptoms

Visual Studio 2017 should continue to work for most scenarios; however, if you open Tools / Extensions and Updates you might see an error dialog that reads:

Cannot find setup engine instance.

Additionally, you will not be able to discover workloads and components you have not yet installed in Quick Launch nor would breadcrumbs (recommended project and item templates not yet installed) appear in the New Project and New Item dialogs.

Workaround

A fix is forthcoming, but until then if you can’t change HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\VisualStudio\Setup you should set both of the 32- and 64-bit registry keys on a 64-bit operating system to make sure that both 32- and 64-bit applications works.

reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\Setup /v CachePath /t REG_SZ /d X:\VS\Packages /f /reg:64
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\Setup /v CachePath /t REG_SZ /d X:\VS\Packages /f /reg:32

The documentation has been updated and should be live shortly.

Author

Heath Stewart
Principal Software Engineer

Heath is an application architect and developer, looking to help educate others to learn professional development. Besides designing and developing applications he enjoys writing about intermediate and advanced topics. Heath also consults for deployment packages and scenarios within Microsoft and for external customers.

0 comments

Discussion are closed.