AIR Updater


I’ve written a class to make the updating process of AIR-projectors easier.
The class uses the great AIRRemoteUpdater classes, written by Claus Wahlers (http://codeazur.com.br/lab/airremoteupdater/).

How it works:

You create an AIRUpdater object, configure the wanted listeners, and ask it to check for an update.

Code in AS3:

var updater:AIRUpdater = new AIRUpdater ("path_to_air_file", true, true);
updater.addEventListener(AIRUpdaterEvent.COMPLETE, updateCompleteHandler);
updater.addEventListener(AIRUpdaterEvent.CONFIRM, updateConfirmHandler);
updater.addEventListener(AIRUpdaterEvent.WARNING, updateWarningHandler);
updater.addEventListener(AIRUpdaterEvent.CONNECTION_ERROR, updateErrorHandler);
updater.update();

function updateCompleteHandler(event:AIRUpdaterEvent):void
{
   // Starting application.
}

function updateConfirmHandler(event:AIRUpdaterEvent):void
{
   // Update confirmation requested.
   // Current version: updater.localVersion
   // Remote version: updater.remoteVersion

   // on confirm: updater.update (false);
}

function updateWarningHandler(event:AIRUpdaterEvent):void
{
   // Update warning message.
   updater.install ();
}

function updateErrorHandler(event:AIRUpdaterEvent):void
{
   // Update file not found.
}

The constructor of the class requires the path to the air file, and gives you the choice to stop the updating process for a confirmation and/or a warning.

Files:

You can download the zip-file here:
AIRUpdater.zip

I’ve included the original AIRRemoteUpdater classes in the zip file.
Note that these classes are not written by me, so more recent versions might be available.

,

  1. No comments yet.
(will not be published)
  1. No trackbacks yet.