The Easy Way to Deploy Your AIR Application

The steps to set up your AIR application for download are pretty straight forward, but there is one catch to make it work.  You'll need to set up your web server to recognize requests for files that have the .air extension. To do this in Apache you can add this entry to your .htaccess file:

AddType application/vnd.adobe.air-application-installer-package+zip .air

In IIS you can do this by going to the 'properties' window for your website and clicking on the HTTP Headers tab. Click the 'File Types...' button and then click 'New Type...'. Enter '.air' for the 'Associated extension text box and enter the line below for the 'Content type (MIME)' textbox.

application/vnd.adobe.air-application-installer-package+zip

Once you've got that all taken care of, you can follow the steps below to complete the process.

1. Download the SDK at http://www.adobe.com/products/air/tools/sdk/

2. When you have the files extracted, goto the 'samples\badge' directory and copy the following files:
    AC_RunActiveContent.js
    AIRBadge.as
    badge.swf
    default_badge.html
    test.jpg (you can replace this image with your own if you want to)

3. Paste these files into a directory on your webserver, such as (I created a directory  called 'AIR' in the root dir of my website)

4. Copy your .air file into the same directory

5. Open default_badge.html and find the line that looks like this:
    'flashvars','appname=My%20Application&appurl=myapp.air&airversion=1.0&imageurl=test.jpg',

6. after 'appurl=' put the absolute path to your .air file.  Note that the line setting used a relative path (myapp.air), but if you use a relative path you'll get an error when you try to install your application.  Here's what I used:
    http://www.remwebdevelopment.com/air/airsample.air

7. Although you don't have to change anything else to make this work, you should also set the other varialbles on this line, such as 'appname='.  Note that the values that you enter must be properly encoded.


RECENT ARTICLES