Pablo Galiano : VS Shell and the registry

Subscriptions

<September 2010>
SuMoTuWeThFrSa
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789

News

Subscribe to Pablo Galiano by Email

Post Categories

VS Shell and the registry

As we know Visual Studio depends on the registry. Every VS component is registered in the registry and Visual Studio reads this information to configure and load the components at runtime.

This is also the case for a VS Shell Application. The only difference here is the main registry hive used. And this main hive is "Isolated" from the Visual Studio main hive.

The root hive for VS Shell applications is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppEnv\9.0\Apps\

Every VS Shell application has its own main hive and the name of this hive is composed of the stub's name and GUID.

We can see that name on main cpp file for our stub:

nRetVal = Setup(W2A(lpCmdLine), L"MyVSShellApp_490526d0-3a2e-4a41-8bce-d01f8c1df6b7", NULL);

This means that for this specific example the main hive for MyVSShellApp is:

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppEnv\9.0\Apps\MyVSShellApp_490526d0-3a2e-4a41-8bce-d01f8c1df6b7

Now lets talk about the /Setup switch. For the other available switches please refer to my previous post.

When we do a MyShellApp.exe /Setup a couple of things happens:

  • The registry main hive is created
  • The menus cache is refreshed
  • VS templates are installed
  • ...

In this post I will go into the details of the registry information created.

The /Setup switch tells appenvstub.dll to create the registry information based on the pkgdef files found under the \PackagesToLoad directory, and these are the steps:

  • The VS Shell application hive is created
  • All pkgdef files found are parsed and every single line is added to the registry (with support of parameter replacement variables)
    • VS Shell application pkgdef file
    • Any other VS package pkgdef file
  • The %DevEnvDir%\Common7\IDE\AppEnv\AppEnvConfig.pkgdef file is parsed and every single line is added to the registry
  • The %DevEnvDir%\Common7\IDE\AppEnv\BaseConfig.pkgdef file is parsed and every single line is added to the registry
  • The VS Shell application pkgundef file is parsed and every single line is removed from the registry

Now when we do a MyVSShellApp.exe /Remove, the main registry hive for our VS Shell application is removed from the registry.

Pablo

posted on Thursday, November 22, 2007 8:19 AM by pga

# Help with using the VS2008 Shell @ Tuesday, November 27, 2007 4:48 AM

Pablo has written a series of posts that should be of help to anyone thinking of hosting their applications

Anonymous

# Help with using the VS2008 Shell @ Tuesday, November 27, 2007 5:46 AM

Pablo has written a series of posts that should be of help to anyone thinking of hosting their applications

Anonymous

# Pablo Galiano's VS Shell posts, in a nutshell @ Friday, December 14, 2007 4:12 PM

Pablo Galiano has a great ongoing series of technical blog posts on the new VS 2008 Shell . Links to

Anonymous

# Pablo Galiano's VS Shell posts, in a nutshell @ Friday, December 14, 2007 4:13 PM

Pablo Galiano has a great ongoing series of technical blog posts on the new VS 2008 Shell . Some of the

Anonymous

# Registry Cleaner @ Friday, May 02, 2008 11:48 AM

Skype identifies a set of SkypeOut problem codes clearly in their FAQ Some of these relate to the volume of traffic, and it\'s quite possible that scaling up the PSTN interconnects isn\'t as easy as 123. However a more troubling type of complaint exists. These are the ones where the call fails for sound, or latency. It\'s connected but you can\'t hear each other. Is it Skype, is it PSTN, is it who? I don\'t know. It may have cost you a couple of cents. If I get a few it is not a problem when I make many many...

Anonymous

# re: VS Shell and the registry @ Thursday, July 24, 2008 9:49 AM

rn52jd <a href="http://ehxnhaixcjsf.com/">ehxnhaixcjsf</a>, [url=http://bydhzjbmuaoc.com/]bydhzjbmuaoc[/url], [link=http://hbxiqdvuhjeb.com/]hbxiqdvuhjeb[/link], http://vrjkxsystroc.com/

coifzrcugwm