Enterprise Services, COM+ Proxies & ClickOnce

Although WCF and .NET 3.0 seem to have taken over my life I am still doing a fair amount of .NET Enterprise Services stuff. Hey, it’s good technology and it got us through some tough times, right ? There are actually still a lot of people out there with a big installed client base of Windows 2000. No, really, there are. While we’re all getting excited about Vista there are a lot of people who never made it to XP. Sure they have moved their server platforms to 2003 for better stability, performance, scalability etc but what’s the business case for the workstations especially when you add the cost of a roll out and updating the PC hardware ?
So these people don’t get to play with our new .NET 3.0 toys, at least not “client-side” anyway. In some environments I have been building hybrids where the client-server communications within an application works over .NET Enterprise Services and DCOM but between the application servers WCF is used to create SOA-type messaging with Pub/Sub events and so on. You know, the cool stuff Juval Lowy likes. This is actually a nice compromise. The move to WCF was always going to be gradual anyway so you can phase it in at the server level and roll it down to the clients as they catch up.
This has thrown up some interesting problems though. Notably with ClickOnce because my .NET 2.0 SmartClient UI application needs to be deployed with its COM+ proxy. When I first came across this it quickly became apparent that I would have to create a pre-requisite package containing my proxy and then use the ClickOnce bootstrapper to install it. Not a problem per se. I already had Brian Noyes book on ClickOnce, plus Michelle Leroux Bustamante’s downloadable examples and I had found the Bootstrap Manifest Generator on GotDotNet, so I was well armed in that respect.
However, I was not happy with the whole approach and furthermore it raised some problems about the rights of the user running the ClickOnce install to perform com registrations on their workstation. So I did what any responsible architect would do and I Googled the issue…without much success. I found a post on CSLA.net by Rocky Lhotka in which he desrcibed the issue as “problematic” so I emailed him to see if it was a problem he’d solved or if “problematic” was simply a euphemism for “more trouble than it’s worth”. He replied almost immediately (which was cool because he’s a legend and all) but suggested that I read Brian Noyes book (which was not because I already had it open in front of me).
An alternative approach, since the pre-requisite is an .MSI package, is to use Active Directory and Group Policy to deploy the proxy. AD allows you to either publish or assign an application. The main difference being that with publication you can only publish to a user whereas you can assign to either a user or a computer. Applications that are published or assigned to a user will only have their icon(s) installed next time the user logs in. The application will not install until the user first tries to launch it. Applications that are assigned to a computer will be fully installed next time the computer is rebooted.
Assign Publish
Computer Complete application installed on next boot. n/a
User Application icon(s) only installed on next login. Complete application installed on first use. Application icon(s) only installed on next login. Complete application installed on first use.
OK, so now we can deploy our proxy without the security issue but we have separated its deployment from the deployment of the client application that uses it and we have introduced a reboot into the process. I suppose we could go the whole hog and package the entire client application along with its proxy as an MSI and AD-deploy it that way but I really like the idea of ClickOnce and I’m loathe to abandon it completely at this stage.
So now ClickOnce throws us another curve ball. Let’s say we bump up the permissions of the users on these workstations so they can install the proxy. So the first user logs in and installs the app and its pre-requisites via ClickOnce. It all works fine, we have beer. They log off and the next user logs on and has to install the app aswell because ClickOnce installs apps in the user’s local settings cache. But the proxy is already installed and ClickOnce tries to install it again. The install of the proxy fails which causes the whole installation to fail. We put down our beers and are sad.
It turns out that subsequent users can actually install and run the application without the prerequistiues by clicking on the lauch link on the install page. Our proxy is installed “globally” but our app is installed per user. So it “kinda works”. We go back to our beers agreeing with Rocky that this is indeed “problematic”.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: