Matt
Matt

Reputation: 1911

Programmatically specify Private Extension Gallery in Visual Studio 2012

One of the newest features in VS 2012 is the ability to create Private Extension Galleries, which allow you to build your own extension repositories and not have to publish them to the world (internal company tools, etc.). I've successfully created one as described in the MSDN blog I referenced, but I'm wondering if anyone knows of a way to programmatically set the details of the gallery - the name and URL, and then "Apply" it - so that each person who wants to access it doesn't have to manually enter in the info.

I looked in the registry to see if I could install a key, and I think it's possible but not exactly trivial. Anyone have any insight?

Upvotes: 3

Views: 1220

Answers (2)

Matt
Matt

Reputation: 1911

I'm going to mark Jason's answer as accepted, because he pointed me in the direction of how to properly do it which was my ultimate question. However, I do want to add another solution which does work if this is all you need:

If you manually add your private gallery details to Visual Studio, your registry key will be created for you. Go to:

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\ExtensionManager\Repositories\[Dynamic Guid]

and export that key to a normal .reg file. You can then either create a simple batch script to install the key for you on other computers, or just have people use the .reg file to install it themselves.

Upvotes: 3

Jason Malinowski
Jason Malinowski

Reputation: 18976

The registry keys to set are documented under http://msdn.microsoft.com/en-us/library/hh266735.aspx. $RootPath$ would indicate a path like HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0 on the user's machine. Minimally, you could write a little tool that just sets those registry keys.

If you want to be really fancy, you could take that .pkgdef example and stick that inside a .vsix. Then, installing that extension would register the private extension gallery. A bit meta, but that could prove useful.

Upvotes: 4

Related Questions