Updating AIR applications is easy!

When the Adobe Integrated Runtime (AIR) first came out I was immediately interested to see that what it would offer in the form of update management. Sure enough there was support for it to the point where you could initiate an installation of an update once it has been downloaded. That in itself I thought was a really good piece of functionality and I started to experiment with it immediately. But now, Adobe has offered an even greater update support with their Update Framework available on labs. This framework helps with checking for updates, downloading and installing among other things. Although there are many components and configuration to consider the essential code looks very simple. Here is a singleton class I have put together that leverages the update framework:

public class UpdateManager{
private var appUpdater:ApplicationUpdaterUI

/*
* Static singleton class
* singleton function and singleton variable
*/

protected static var updateManager:UpdateManager
public static function getInstance():UpdateManager {
if ( updateManager == null )
updateManager = new UpdateManager();
}
return updateManager;
}

public function UpdateManager(){
appUpdater = new ApplicationUpdaterUI()
appUpdater.configurationFile = new File("app:/content/data/update.xml");
appUpdater.initialize();
}

public function updateNow():void{
appUpdater.checkNow();
}

}

There are two basic "flavors" of the update framework, one without a user interface and one with it. I have chosen to use the framework with it's default UI and that's often a good starting point for an application. If you have time later you can always switch over to the UI free framework (that's why I like to isolate all calls to the update framework in my own class).

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options