Wednesday, January 10, 2007

ClickOnce and RegFree COM

So I've been doing quite a bit of reading at work lately about the new ClickOnce deployment model from Microsoft, and I'm finding out how cool it really is. It is designed to install smart client applications to end user machines. It does so in a manner as to not impede on any user rights limitations in regards to the install. The book I read was Smart Client Deployment with ClickOnce, The author did a good job of giving an overview of the process(es) as well as touching on more than enough details for my needs. My favorite chapters included


  • Chapter 2 Initial Deployment with ClickOnce - A complete walkthrough and explanation of what happens in a ClickOnce deployment.
  • Chapter 6 ClickOnce Security - In particular I enjoyed learning about Trusted Root Certificates. This chapter also discusses user account permission levels and how ClickOnce is designed to work with low level accounts.
  • Chapter 7 Prerequisite Deployment with the Bootstrapper - A bootstrapper includes any additional components or services that need to be installed along with the app, these usually require elevated privileges to install.

One particular problem I need to solve is how to include ActiveX objects in the install. You see the application is currently a web application and is being converted to a smart client by using a windows app that will house a custom browser that will access the original web application, make sense? While it is possible to include the ActiveX objects in the custom browser this is not desirable because they will likely go away in the not-so-far-off future anyhow. It will be much easier if I could manage them in the deployment model instead of in the code base, not to mention a little less overhead every time the new smart client windows app loads. Normally ActiveX objects, being the COM objects that they are, are registered in the Windows registry, thus requiring elevated privileges to install. One would think this would require a Bootstrapper if the objects are to be included in the install, but fortunately for us Microsoft has come up with a solution called Registration-Free COM. This essentially registers an ActiveX object in the application directory (using an XML manifest file) instead of the registry, and it is designed to work right along with ClickOnce! How great is that?!?! (My wife thinks me a little off kilter when I get so excited about these kinds of things) So it solves the problem of needing elevated privileges to complete the ClickOnce install. In addition it also helps to prevent any version conflicts between different users on the same machine and avoids any registry corruption issues (DLL Hell).

No comments: