Accessibility

Table of Contents

Using the Adobe AIR update framework

How to use the Adobe AIR update framework

Using the update framework is easy. The simplest approach has three main steps (for an application created in Flex using the update framework with the default UI):

  1. Add the update library SWC file to your application.
  2. Create and add the updater descriptor file. This is a small XML file that keeps information needed by the updater (for example, what version is available, from where to take it, and what info to display). This file sits on your server, and when the application starts up it loads this file to see if any updates are available.
  3. Write about 10–15 lines of code in your AIR application—and you are done!

Figure 1 shows a typical workflow for an application that uses the update framework.

A
  typical workflow when the Adobe AIR update framework is used

Figure 1. A typical workflow when the Adobe AIR update framework is used

If the version number from the updater descriptor file is higher than the version number of the currently installed application (as set by the version tag from the application descriptor file), the update framework determines that a new version is available.

Furthermore, the version written in the updater descriptor file must be identical to the version set in the new AIR file (the packaged AIR application). If they are not, an error will be raised and the update will not be performed. For a list of the error codes that the framework can throw, refer to the language reference for Flash, Flex, or HTML/Ajax developers.

For version formats, you can use any of several conventions:

  • 0.9, 0.9.1, 1.0, 1.0.1
  • v1, v2, v2.1
  • a, b, c

To keep it simple and easy to follow, I use the first one.

Updating an application and security

One of the main benefits of the update framework is the ability to easily roll out updates to fix security issues. It would be a little ironic if the framework itself didn't provide security when it is used, and instead allowed an installed application to be downgraded, for example.

Fortunately, the update framework enhances the security of your application. For example, there is no way to "update" your application with an older version. This means that there is no way to accidentally roll out a version older than the ones that are installed by your clients. The same version number must be set in the AIR file (the AIR application packaged for release) and in the updater descriptor file. Furthermore, an AIR application can't be updated unless it was signed with the same certificate as the one that is being used to update it.

Keep in mind that the update framework needs a connection to the Internet or your local network. The new version and the updater descriptor files sit on a web server. Thus, when the application checks for updates it needs a connection to reach these files. If there is no connection, no update will be possible.

Because the Adobe AIR update framework is flexible, you decide how best to handle the update process. Your process can implement any of the following approaches:

  • When the application is started, have it check whether a new version is available.
  • Check for new updates at defined time intervals.
  • Let the user decide when to check for a new version, download the update, and install the file. Alternatively, you can enforce all these actions.
  • Notify the user what fixes or new features the update provides.