Adobe AIR Beta 3 – descriptor file porting
I ported AirSpace today from AIR Beta 2 to Beta 3 and overall it wasn’t that bad. Heh! First off, I originally used Rich Tretola’s UpdateManager class for AirSpace’s updates before, and it looks like he updated his entry for Beta 3 already. Wish I knew this before I upgraded mine 😛 Oh well, it’s done now. If you want a cool way to update your apps, that one works like a charm.
Nothing massive changed, its all pretty easy, but rather than chase all the new stuff down, I figured I’d post in case someone else runs into issues.
The first issue I had, was to remove references to Shell.shell and replace with nativeWindow inside the ActionScript. At least that’s one thing the new compiler was griping about and is now fixed. Referencing the application descriptor file from within the code had a few minor changes. The first thing I did after installing Beta 3 for AIR and Flex 3, was just create a new AIR project for AirSpace. That way, I had a new descriptor file to play with and seemed easier than chasing down any artifacts in the old one.
I had the version number and appID in the OLD descriptor file (Beta 2) right at the root node:
In the new descriptor file, it’s laid out differently. I just put it all in together like so:
com.pxldesigns.airspace AirSpace AirSpace 22.214.171.124 AirSpace is a MySpace Style Editor created with Adobe AIR PXL Designs, LLC
Big deal, right? So then I was no longer getting errors when trying to build the release version with my nifty self signed certificate, the one that warns people going to install it that I could have built a horrible nasty app that pops up ads 24-7 and eats up all the ram. Ha, kidding! I wouldn’t build such a thing…mental note.
Referencing the new app version from inside the MXML or ActionScript is slightly different, and I use this in a few places for AirSpace. Still no biggy, like I said, it would have saved some time if I remembered to check Rich’s code first, none the less, I figured it out quick enough.
private var appXml:XML = NativeApplication.nativeApplication.applicationDescriptor; // use of name space from the descriptor file private var ns:Namespace = appXml.namespace(); private var currentVersion:String = appXml.ns::version; //
in the app descriptor
Next step, Shell.shell.exit(); became nativeWindow.close(); now. The compiler no longer liked references to Shell.shell, so that fixed my problem.
I thought I’d need to change some File refs because the compiler tossed up errors at first for this line:
var file:File = File.applicationDirectory.resolvePath("index.html");
but after running “Project –> Clean..” a few times, the compiler stopped griping. Dunno about that one yet, it works fine for me, I haven’t had time to check if there’s any massive changes with files and directories yet again, but after cleaning this wasn’t an issue for me anymore.
The only thing that gave me a headache was resigning my certificate and getting that up and running again. After “cleaning” a few zillion times, and creating the new app descriptor file, I created a new certificate by opening a command prompt, changing directories to “C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\bin” and running the ole adt command:
adt -certificate -cn yourCertName 1024-RSA ../newCertName.pfx yourCertPassword
Then packaged everything right in FlexBuilder 3 “Project –> Export Release Build” and browsing for the new cert, and entering the password. Whoopie, done!
The moral of this story? First, always check Rich’s blog before making a move 🙂 save yourself the trouble of porting to Beta 3 by just creating a new AIR project (complete with new descriptor file) import your files, update your new desriptor file and pop out your self signed cert to notify the world that you haven’t yet purchased a Thawte cert like me because I’m too cheap.