About the AutoUpgrade Class Framework
The AutoUpgrade classes were created with flexibility in mind, so all the methods and properties are public.
You can create a minimal implementation of the AutoUpgrade class by simply calling Create
, followed by a call to IsUpgradeAvailable
(as shown above), or you can completely control the upgrade process from within your application by calling IsUpgradeAvailable(false)
and reading and writing to the UpgradeFiles
The code download contains a Word file (Class specification.doc) that has a full description of the AutoUpgrade properties, methods and events, so I won't show them all here, but you can see the key methods and properties in the sidebar Key AutoUpgrade Methods and Properties.
Adapting AutoUpgrade for Different Deployment Scenarios
There are several ways you can adapt the AutoUpgrade framework for various deployment scenarios, such as.
- Use a Web service to automatically generate the manifest. The AutoUpgrade class can be used to automatically generate a manifest, using the contents of a subdirectory. The code sample (AutoUpgrade.Web) shows how to provide a Web service that one of the overloaded Create methods can access to generate a manifest file "on the fly".
- Use AutoUpgrade to do a user-driven upgrade check, or create a program to check for an upgrade periodically. The code provided in the section "Adding auto-upgrade to your to your application" (above) can be used just as easily to provide a user-driven upgrade, or to check for an upgrade every few days, instead of every time the application starts. You must terminate the application to release file locks before upgrading if you're using the AutoUpgrade.EXE stub.
- Deploy an application "bootstrap" to clients that automatically downloads the full application. You could use the AutoUpgrade class and a small bootstrap program, or the AutoUpgrade.exe upgrade stub with a modified manifest file (with the "SourcePath" set correctly) to deploy your application to end-users. The AutoUpgrade exe, AutoUpgrade.dll and a manifest file are small enough to send by email. You could even add an Installer class to one of your key assemblies to create start menu icons.
AutoUpgrade does not automatically handle COM registration or installation to the global assembly cache. If you need to perform such special installation functions, you must add an Installer class to your assembly as described above and add the code to perform the special actions.
AutoUpgrade Reduces Costs
The AutoUpgrade class framework was created with a couple of scenarios in mind:
- Software vendors or IT departments developing single-user applications who want to provide an automatic upgrade facility to end-users.
- Software vendors or IT departments developing multi-user applications who create a "server setup" to push new client versions automatically when the server software is upgraded.
Adding automatic upgrade capability can reduce the cost of ownership for your clients by bringing the ease-of-deployment of Web-based applications to your Windows forms applications. By making it easy for end-users to have the latest version installed, you can reduce support calls (ever had a call for a problem you fixed months ago?), and provide greater end-user satisfaction by "pushing" upgrades that fix problems before users even encounter them.
For most applications, using the procedure listed in the Adding Auto-upgrade to Your Application
section of this article, you can add AutoUpgrade functionality in less than an hour. The classes are flexible enough that you should be able to adapt them to your particular scenario with ease.