Many of the nation's top companies are using Adobe AIR to develop interactive and connected applications. These applications will fuel the next iteration of the Internet. If your plan is to develop the next great AIR application, what will you do after you release your creation to the general public? During the creation process you might not think a great deal about updates, but when a serious coding flaw is revealed, updates could become your primary concern.
The Adobe AIR framework has a built-in mechanism for handling updates. This mechanism is quite powerful because it does not force you, the developer, to handle updates in any certain way. Instead it enables you to integrate updates in whatever manner that would be best for your application.
This mechanism allows you to call a method that will shut down the current application and load the new version while still preserving the data in the local folders. To ensure security and consistency, there are a few important things to keep in mind when using this integrated method for updating an AIR application:
update function of the Updater class.update function. When
the update is completed, the application will restart.In ActionScript the updates are handled with the flash.desktop.Updater class, and in JavaScript updates are handled by the air.Updater class. (You
must include the AIRAliases.js file in your JavaScript application to use this
notation. If you do not, the Updater class can only be referenced by window.runtime.flash.desktop.Updater.)
To perform an update in either ActionScript (for Flash or Flex) or JavaScript,
you need to follow the same three steps:
Updater class.File object with a reference to the new application on your
computer.update function of the Updater class and pass
in the version number of the new application.Here is an ActionScript example from Adobe Livedocs Flex 3 Language Reference:
var updater:Updater = new Updater();
var airFile:File = File.desktopDirectory.resolvePath("Updated_Application.air");
var version:String = "2.01";
updater.update(airFile, version);
The Updater class inside of Adobe AIR empowers the
developer, but because of the flexibility, the developer has to write the
implementation. There is no built-in method that "goes and checks the same
place for a new version." In all likelihood, you will implement updates in
a similar method across all of your Adobe AIR applications. This makes the
update process a prime candidate for a central ActionScript class that will
manage the entire update process. However, for this to be effective, it will
need to work for any Adobe AIR application irrespective of whether it was
created with Flex, Flash, or HTML/JavaScript.
This ActionScript class only manages half of the update process; you'll also need a method for serving the application updates. If the application is put on a web server and made accessible, you have very little ability to control how it is delivered. If older versions are left accessible, there is a risk for some users downloading an outdated version. It would be ideal to store the applications outside of your web tree and simply serve them when they are requested. This also leaves the door open for extensibility, because if you ultimately control the content, you can control how and when it is delivered.
To bring these ideas to fruition, both a client-side implementation and a server-side implementation will be needed.