Peter Elst

Flash Platform Consultant
  • Home
  • About me
  • Articles
  • Downloads
  • Contact me

Retrieving the AIR application version

8 02 2008

If you’ve played around with AIR and are thinking about releasing some applications into the wild, you’ll want to make sure you have something in place to push updates to your users when you’ve got a new version available.

The user can download a new version of your .air file, double-click the file and the AIR runtime will notice its an update to an existing application and notify the user.

There is another way to handle the update process which is much more straightforward to your user. You can access the application descriptor XML of your AIR app and retrieve the version number, check that against the latest version number you store in a text file somewhere on your server.

If the version number on the server is higher than the version of the currently installed AIR app, you download the .air app and trigger an update to happen using the flash.desktop.Updater class.

Getting hold of that version number in the application descriptor is however not as straightforward as you might expect and requires the following code:

var descriptor:XML = NativeApplication.nativeApplication.applicationDescriptor;
var ns:Namespace = descriptor.namespaceDeclarations()[0];
var version:String = descriptor.ns::version;

 
I personally would’ve liked to see the version number, name and other commonly used settings from the applicationDescriptor as properties on NativeApplication.nativeApplication. I’m yet to find a need to work with the raw applicationDescriptor XML and it seems needlessly verbose to retrieve a simple value.

Will post a complete walkthrough of using the Updater API along with several other examples after my talk at FITC Amsterdam.


 
Creative Commons License This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

« Pistach.io is coming soon… Interview - Aral Balkan on Singularity »



Actions

  • rss Comments rss
  • trackback Trackback

Informations

  • Date : 8 February 2008
  • Categories : AIR

2 responses to “Retrieving the AIR application version”

16 03 2008
flyingman15 (20:19:52) :

usefull information. I was looking for it.
But I don’t like the idea of it being accessible to the user…we never know. Don’t you think ?
I use a VERSION const in the application….and disrespect “unicity” of information by having it in two places at my own risks. One of my ex teachers would kill me :)

18 05 2008
barry.b (16:09:39) :

“Will post a complete walkthrough of using the Updater API along with several other examples after my talk at FITC Amsterdam.”

thankyou Peter. looking forward to reading them.

“The user can download a new version of your .air file, double-click the file and the AIR runtime will notice its an update to an existing application and notify the user.”

there’s no other way to push updates to the user, other than the app calling home to check first when it loads, yes?

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Or add a Video Comment
with
Seesmic Logo
« Back to text comment





Conferences

The Actionscript Conference

Training Partners

multimediacollege

SkillsMatter

Badges

Alltop, confirmation that I kick ass

  • Categories

    • AIR RSS category feed
    • Ajax RSS category feed
    • CSS RSS category feed
    • Eclipse RSS category feed
    • Events RSS category feed
    • Flash RSS category feed
    • Flash Lite RSS category feed
    • Flex RSS category feed
    • Gadgets RSS category feed
    • General RSS category feed
    • JSFL RSS category feed
    • Mac RSS category feed
    • Open Source RSS category feed
    • PHP RSS category feed
    • Podcasts RSS category feed
    • Publications RSS category feed
    • Rants RSS category feed
    • Reviews RSS category feed
    • Thought of the Day RSS category feed
    • Training RSS category feed
    • Twitter RSS category feed
    • Video RSS category feed
  • Resources

    • Brajeshwar Oinam
    • Chafic Kazoun
    • Edwin van Rijkom
    • Peldi Guilizzoni
    • LordAlex Leon
    • AndrĂ© Michelle
    • Veronique Brossier
    • Robert M. Hall
    • Keith Peters
    • Marco Casario
    • Stephen Downs
    • Matthew David
    • Serge Jespers
    • Simon Barber
    • Ted Patrick
    • Ralf Bokelberg
    • Owen van Dijk
    • Mario Klingemann
    • Burak Kalayci
    • Jonathan Kaye

     
     

    Adobe Community Expert

    See my profile on LinkedIn



    Harz Ferienwohnung Suchmaschinenoptimierung Geschenkideen Harz Ferienwohnung Pagerank Webkatalog Webhosting