Deploying an Application Update
To deploy an update, you must create a server manifest file that contains information about the new version and its files. Before you generate the manifest, you should set up your deployment server and create a folder on a network share to contain your application updates. You should adopt the following pattern so that you and your release team can build an extensible framework for making application updates available on your network:
| |---Application Name
| | |---Manifest.xml
| | |---<version #, e.g. 220.127.116.11>
| | | |---<application files>
Using this structure lets you set up a deployment server for multiple versions of multiple applications. It's sensible to give the folder that will hold your application files the same name as the new version numberbecause the Updater will download the files into an identically named folder on the client, and will help keep the multiple versions of your app's files neatly organized.
After copying your application files into the new folder you're ready to fire up the Manifest Utility (see Figure 6
|Figure 6. The Manifest Utility: This utility lets you specify options for the location and version of files used to update your application, along with RSA security to validate that the downloads requested by the Updater application haven't been tampered with.|
- Enter the path to the new version of your application's files into the Update Files Folder field. The Updater will download all the new files into a new folder, so you need to make sure that all of the files required for your new version to run are available in this foldereven those that haven't changed from the previous version.
- Set the Update Location field to the folder on your deployment server from which the update will be downloaded.
- Enter the new version number into the Version field. The Updater compares this version number with installed version number to determine whether it needs to download an update.
- Paste the private key you generated earlier into the Key textbox (remember to set the Validator Class combo to "RSA," or the manifest creation will fail with an exception.
This is the minimum amount of configuration data you need to enter; you can now hit the Create Manifest button to generate the XML manifest file. Deploy the manifest to the server, and remember to set the <xmlFile>
element in the <Updater>
config section of the AppStart app.config
file to the manifest's location.
The following tips may save you some time when configuring this last crucial step:
- It sounds like common sense, but ensure that the network location you have selected for your updates is visible via HTTP from your client machines.
- Remember to apply the proper permissions to the update folder and manifest file, so that the Updater can access the manifest file and read its contents, and then successfully stream the application files to the client.
- The Updater will access the manifest file over HTTP, so you may find the best solution is to set up a virtual directory to distribute application updates. Doing that will resolve most security problems;
- The folder containing your updated application files needs to contain all the files required for your application to run; it is not possible to update individual files or assemblies (without changes to the Updater block), and if you try to do this the updates will download just fine but your application will fail to run when the user launches the new version;
- You'll usually need to generate a manifest each time you need to deploy a new version of your application, but remember to reuse the same private key for all versions of your application.