A customer asked a question last week about how to detect whether or not Visual Studio 2005 is installed on a computer, and if so, which edition is installed and what ___location it is installed to. There are a ton of registry keys written by VS 2005 setup, so deciding which keys are safe to use to detect the presence and ___location of this family of products can be tricky, especially when you factor in all of the various editions and non-English languages. In addition, we unfortunately have not yet designed a registry hive specifically to allow applications to detect the presence of Visual Studio like we have in the .NET Framework and other redistributable packages that are installed as a part of Visual Studio setup.
Here is a list of the registry keys/values that can be used to detect each of the editions of Visual Studio 2005. In each case below, ProductDir is a REG_SZ value that contains the install root (which by default will be c:\Program Files\Microsoft Visual Studio 8).
- Visual Basic 2005 Express - HKEY_LOCAL_MACHINE\Software\Microsoft\VBExpress\8.0\Setup\VS\ProductDir
- Visual C++ 2005 Express - HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\Setup\VS\ProductDir
- Visual C# 2005 Express - HKEY_LOCAL_MACHINE\Software\Microsoft\VCSExpress\8.0\Setup\VS\ProductDir
- Visual J# 2005 Express - HKEY_LOCAL_MACHINE\Software\Microsoft\VJSExpress\8.0\Setup\VS\ProductDir
- Visual WebDev 2005 Express - HKEY_LOCAL_MACHINE\Software\Microsoft\VWDExpress\8.0\Setup\VS\ProductDir
- Visual Studio 2005 Standard - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\VS\Std\ProductDir
- Visual Studio 2005 Professional - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\VS\Pro\ProductDir
- Visual Studio 2005 Team Edition for Software Architects - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\VS\VSTA\ProductDir
- Visual Studio 2005 Team Edition for Software Testers - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\VS\VSTT\ProductDir
- Visual Studio 2005 Team Edition for Software Developers - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\VS\VSTD\ProductDir
- Visual Studio 2005 Team Suite - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\VS\VSTS\ProductDir
- Visual Studio 2005 Premier Partner Edition - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\VS\IDE\ProductDir
- Visual SourceSafe 2005 - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\VS\VSS\ProductDir
- Visual Studio 2005 Tools for the Microsoft Office System - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\VS\VSTO\ProductDir
If you do not care which edition is installed, you can use the following registry value to detect whether or not any edition of Visual Studio 2005 is installed:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\VS7\8.0
8.0 is a REG_SZ value that specifies a fully qualified path to the Visual Studio 2005 root installation directory. By default, this value will be set to c:\Program Files\Microsoft Visual Studio 8, but will be different if the user has installed Visual Studio 2005 to a non-default path.
<update date="12/1/2006"> Added a registry value that can be used to detect the presence of any edition of VS 2005 if you do not care about which edition is installed </update>
Comments
- Anonymous
April 11, 2006
The comment has been removed