I have been working on a few Adobe AIR projects and along the way as I run into what I feel will be common pieces of functionality to many of the AIR applications I may write, I have been abstracting that functionality and breaking it out into various Flex library projects. After reading the the Developer Center article on Managing Adobe AIR updates with ColdFusion 8, which helped me understand the general process, I decided to tailor the code that I was using in my current AIR application.

What I came up with was a pretty simple approach. I decided to use information that was available in the application descriptor ([appname]-app.xml) for update purposes. In setting values for 3 of the keys in the application descriptor with deliberate usage in mind, the information necessary to deal with determining version dominance, location of the latest version info and installers would be readily accessible.

I figured that if the current, running application was going to get it’s version and update information from the application descriptor, then just having that information available in the same format somewhere on the web to download would make for a simple architecture. By using the “applicationID” and “appFileName” to construct a url to this “latest version” application descriptor, I could easily grab this XML and read from it the “appVersion” to compare against the current appVersion. If the latest appVersion is greater than the current appVersion, then the new application installer could be located at a url I contruct from the applicationID, appFileName and appVersion. Here is how I contruct these two URLs from keys within the application descriptor:

currentVersionInfoURL = "http://" + applicationID + "/"+ appFileName + "-app.xml";
currentApplicationInstallerURL = "http://" + applicationID  + "/" + appFileName + "." + appVersion + ".air";

From this, you can see how I use appFileName and appVersion. That is pretty straight forward. Each new AIR installer that I distribute will just follow this naming convention. The applicationID usage is a little less clear, but here is how I use it. For each application that I build, I create a subdomain off of my main domain. Then, I map that subdomain to a folder. When I create a new build for release, I increment the appVersion key in the application descriptor and in that folder, I place the latest application installer and the corresponding application descriptor.

More details on this library can be found at its Google Code project home: http://code.google.com/p/flex-monkey-patches-upda-man/.
Later this week, I will also be posting a useful little AIR application with source code that makes use of this library and should serve as a good sample for this functionality.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis



No Comments »