Programmatically Add External Tool to Visual Studio

I tried to find some information on adding an External Tool to Visual Studio using a Setup Project, and came across this Social.MSDN entry.

While it deals with Visual Studio 2005, the information can easily be modified to work in later versions of Visual Studio.

In your Setup Project’s Registry View, add the following keys:

For Visual Studio 2005

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\External Tools\

For Visual Studio 2008

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\External Tools\

For Visual Studio 2010

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\External Tools\

Below each External Tools key, add a key identifying your tool.

Under the key for your tool, you need to add ALL values (from MSDN above):


The flags that can be or’ed together in “ToolOpt” are the following:

#define TOOLOPT_ISAPPGUI      0x01
#define TOOLOPT_UNICODE       0x40

Note that Setup Project expects decimal notation for DWORD values.

At first, my tool was not displayed because I did not provide the ToolDir value as it is not relevant for execution.

Providing all the values displays the tool’s menu as disabled (grayed).

Opening the External Tools dialog and clicking OK enabled to entry for my new external tool.

4 Responses to Programmatically Add External Tool to Visual Studio

  1. […] The installer adds VS Solution Dependency Visualizer as an External Tool, but it still needs to be manually activated by the user. […]

  2. Is this capability still available in Visual Studio 2019

  3. […] in 2011, I wrote the post Programmatically Add External Tool to Visual Studio and sketched, how Visual Studio stores its External Tools in the registry […]

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: