Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically retrieve Visual Studio install directory

Tags:

I know there is a registry key indicating the install directory, but I don't remember what it is off-hand.

I am currently interested in Visual Studio 2008 install directory, though it wouldn't hurt to list others for future reference.

like image 653
Emperor XLII Avatar asked Aug 27 '08 15:08

Emperor XLII


People also ask

Where is Visual Studio install directory?

The \Microsoft\VisualStudio\Shared directory is where Visual Studio stores the files that are shared by side-by-side Visual Studio installations. SDKs and tools are also stored in this directory.

Where is Visual Studio 2019 installation path?

Customizing the installation folders Visual Studio IDE: By default, the target path is C:\Program Files (x86)\Microsoft Visual Studio\2019\{editionName}. Download cache: By default, the target path is C:\ProgramData\Microsoft\VisualStudio\Packages.

How do I see what is installed in Visual Studio?

In Visual Studio, the Tab 'Help'-> 'About Microsoft Visual Studio' should give you the desired infos.

How do I change the install path in Visual Studio?

If you've already installed it and want to change the location, you must uninstall Visual Studio and then reinstall it. In the Shared components, tools, and SDKs section, select the folder where you want to store the files that are shared by side-by-side Visual Studio installations.


1 Answers

I use this method to find the installation path of Visual Studio 2010:

    private string GetVisualStudioInstallationPath()     {         string installationPath = null;         if (Environment.Is64BitOperatingSystem)         {             installationPath = (string)Registry.GetValue(                "HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\VisualStudio\\10.0\\",                 "InstallDir",                 null);         }         else         {             installationPath = (string)Registry.GetValue(        "HKEY_LOCAL_MACHINE\\SOFTWARE  \\Microsoft\\VisualStudio\\10.0\\",               "InstallDir",               null);         }         return installationPath;      } 
like image 70
Dim_Ka Avatar answered Oct 01 '22 08:10

Dim_Ka