How can I get the devenv.exe path to install vspackage?

I follow this guide http://msdn.microsoft.com/en-us/library/bb458038.aspx to create a VsPackage Setup. As part of creating the installer class, a link to this place appears in the registry "SOFTWARE \ Microsoft \ VisualStudio \ 9.0 \ Setup \ VS \ EnvironmentPath", which says that it contains the location devenv.exe. I am studying the registry and this place does not exist. What is the correct location of the devenv.exe path? I am using Visual Studio 2008

+6
source share
2 answers

I am sharing my code. He works for me.

String path = GetDevenvPath("9.0"); // For VS 2008 Or String path = GetDevenvPath("10.0"); For VS 2010 private String GetDevenvPath(String vsVersion) { String vsInstallPath = (String)Registry.GetValue(String.Format("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\{0}", vsVersion), "InstallDir", ""); return vsInstallPath + "devenv.exe"; } 
+8
source

You need to access HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VS\EnvironmentPath on 32-bit machines and HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\Setup\VS\EnvironmentPath on 64-bit machines.

If you write a 32-bit program that reads HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VS\EnvironmentPath , you are automatically redirected to Wow6432Node on 64-bit Windows machines.

+5
source

Source: https://habr.com/ru/post/890078/


All Articles