Get installation directory path
I have seen people trying to locate the installation directory of visual studio .net (or any other installed software). Microsoft windows register the installation path of VS.net in the registry. To get the installation path you can request the registry for this information. Following is the code snippet for doing this
Microsoft.Win32.RegistryKey regKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@”Software\Microsoft\VisualStudio\9.0″, true);
string installationDirectoryPath = regKey.GetValue(“InstallDir”).ToString();
if there is any issue in this, please feel free to contact me at irfanyar@gmail.com
Cheers
Irfan Yar
Advertisement