Geeks With Blogs
Gary Pronych 1 Part .NET Developer, 2 Parts Personal Developer; 100% Canadian
Currently my client has a number of WinForm applications in development.
When it came time to deploy these solutions to end users in multiple facilities, discussions of xcopy installations started.

Xcopy is not the best solution; in the past it has been servicable to meet this requirement, today we have better options.

Some of the flaws of xcopy deployment include
- Network connectivity required: if the PC is off it will not get the update
- Installation Lists: You need to know which PC's have your software for when updates are available
- Versioning: Some clients may be running different versions which could damage your data integrity
- Dependencies: If your software requires any components, you will have to create an installer for each version

Since Visual Studio 2005, including 2008, there is a feature built-in feature know as ClickOnce.
It is my experience is that this 'out of the box' feature is under utilized or developers are not aware that this feature exists.

ClickOnce Provides:
- Automatic Update: The application 'calls home' to check for the newest version, clients are prompted to update their version
- Rollback: The client can rollback using Add/Remove; the developer can also make the adjustments using the published version

You can publish an application can be publish to
1) A URL
2) File location including on your network

I won't get into the specifics of the options; they are pretty straight forward and there are articles on how to use the publish wizard.

But what if you have to deploy and manage a legacy application, or a vendor provided application?

Managing Other Windows Applications using ClickOnce

After my client started seeing the benefits of ClickOnce, the next question was, 'Can I use this for my vendor provided applications?'.
This is actually very easy to implement.

1) Create a new Visual Studio project
2) Copy your vendor provided components into your project
3) Call the application executable in your code
namespace AppLauncher
   class Program
      static void Main(string[] args)
         Process.Start("LegacyApp.exe"); //put your executable name here
4) Publish the application with the above publishing wizard.

Anytime the vendor provides an update, overwrite the project files, increment the publish version and publish the update.
Next time your end user executes the Launcher application, they will be prompted to update their application.

We have used this strategy for deploying applications to less than 20 internal users and it has worked well.
We looked into options of creating a 'Whats New' message on first load; which is something we may still look into for the future.

In part 2 of this series, I will describe some troubleshooting and advanced details that will assist you with ClickOnce.

Posted on Sunday, March 16, 2008 9:27 AM Forms Development , .NET , Tools | Back to top

Comments on this post: ClickOnce: Winforms Deployment - Part 1

# re: ClickOnce: Winforms Deployment - Part 1
Requesting Gravatar...
Thanks for this article. I use ClickOnce deployment for our in house CRM application. Recently due to requirements I have had the need to arhitect a "sub module" of the application that plugs into the main application however the development cycles of the main application and the sub module are not synchronized. As a result I've been thinking of creating a separate application for the submodule and when it is ready to plug in to the main application I would use something like what you suggested namely Process.Start

However my ClickOnce is configured to install the main app and any updates on the client's machine instead of running it off of our network. Now if I wanted to use ClickOnce to deploy the separate application for the sub module will that mean the client has to install 2 applications?
Is there a way to bundle the two applications into a single installation however have separate update schedules?

The thing is that moving forward all major sub modules in our application will be designed using this mechanism to allow for separate development schedules and easy plug in into the main application.

Thanks again
Left by Palak Chokshi on Jul 22, 2009 1:41 PM

Your comment:
 (will show your gravatar)

Copyright © Gary Pronych | Powered by: