I have a question regarding the best practice approach to deploying an AIR application to different environments. First off let me qualify my situation. I'm working in an enterprise environement where we have different deployment environements, think of them as dev, test, ci, prod, etc. The AIR application that I'm working on needs to use RESTful services reachable from the same environment from which it was downloaded and installed (these all have different hosts). So the only real variant is a bootstrap url. I'm using AIR because the application needs access to the filesystem.
What I've done, which is less than optimal, is to create a targeted build system using the flex ANT targets. The application uses an embedded config file that is parameterized and filtered for a target environment using ANT before the SWF is compiled. This is in turn is packaged and subsequently archived into a WAR file (java backend) for deployment to the targeted environment.
Optimally I would like to generate a single artifact that I can deploy to all environement. Again the only variant is the URL (actually host) from which the application was downloaded from. I've followed a couple of potential solutions that looked promising but have turned out to be dead ends (perhaps because of my lack of understanding). I saw mention somewhere else of using the args from the install badge to configure the install. I couldn't determine how to get this to work. I also saw mention to passing commandline args. While this would work, assuming I could generate these dynamically during the install, the install and lauch of the applicaztion needs to be seamless for our users.
I'm curious to hear how others have dealt with this issue and even more so about potential solutions aside from targeted builds.
The badge solution seems to be the best for this situation. What aspect did you have difficulty with?
I was trying to accomplish the same thing and yes, the badge API could really help you: in the AIR application descriptor enable browser invocation, then build a custom badge that will pass a parameter invoking the app... the badge will be hosted in a web-page part of the WAR, so just use a JSP page for and have it "introspect" its own server/port/context root, then pass them to the invoked AIR app when the user click on the badge.
This way, you will have both an AIR package and a web-app without hardcoded URL.
This, of course, is unless your AIR application is packaged as a native installer, that unfortunately is exactly my case (see my post http://forums.adobe.com/thread/779361?tstart=0#)