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
<code>
namespace AppLauncher
{
class Program
{
static void Main(string[] args)
{
Process.Start("LegacyApp.exe"); //put your executable name here
}
}
}
</code>
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.