Adobe Air to Exe – Packaging Air app in Windows executable

In AIR 2 you can build an EXE installer file for distributing an AIR application on Windows. I was getting a good few errors at the start trying this (it was a bit of a pain really), so to ease your experience of AIR to EXE, here are the steps I took to complete the process (btw, its just a fluke it worked out to 10 steps, only numbered it retrospectively!).

UPDATE: Serje Jespers created a drag-n-drop tool to accomplish this task, have a look here

I have a follow-up post also, to show how to package the AIR application EXE file, with the AIR runtime .EXE as a single setup file using InstallJammer! – link

Any Questions? Just drop a comment

Firslty, some of the command prompt error messages I was seeing.

  • -storetype is required
  • unable to create temp file in output directory
  • Java not a recognised command


1. Update your Air SDK from Air 1.x to Air 2 Beta 2(its in Beta 2 at the time of writing, but at least Air 2.0 is needed), and also install the Air 2.0 runtime.

2. Once downloaded, look up follow the steps carefully in How to overlay the Adobe AIR SDK for use with the Flex SDK.

3. In the app.xml file (or whatever your .xml app file is called) in the Flex Builder project, you have to add the following line:

<supportedProfiles>extendedDesktop desktop</supportedProfiles>

4. After installing Air 2 Beta 2 SDK & runtime, some old programs may not run, or you might get the Debug error:
Descriptor version does not match runtime version.
Solution: in you projects app.xml file make sure your application descriptor is updated to:

<application xmlns="http://ns.adobe.com/air/application/2.0beta2">

(as opposed to …/application/2.0 or …/application/1.5)

Note: If you look in the SDKs readme in the bin folder (theres really no need to though), you will see that the template option for the latest Air SDK is
“Descriptor.2.0beta2.xsd – An XML Schema Definition file for the AIR 2.0beta2 application descriptor file.”

5. Run your application now to test that all these changes have taken (it should run ok at this point).

Note: Points 1-4 above are covered very nicely in Rich Tretola’s Everything Flex blog, but has less emphasis on errors/problems encountered.

The following steps will show you how to set up the environment to run the ADT commands and export you AIR app as an EXE.

6. Set you environment variables:

You will need the Java JDK; if you dont have it, get it here. Im assuming you already have Flex Builder 3 and AIR SDK installed at this point.

Add JDK and ADT (Adobe Development Tools) to the Environment Variables ‘Path’.

Open Start/Control Panel/System/Advanced System Settings/Environment Variables
Click on Path, then Edit. Add your ADT and JDK ‘bin’ install paths to the end of the other text.
e.g. C:\Program Files (x86)\Adobe\Flex Builder 3\sdks\3.2.0 (Adobe Air 2.0)\bin;C:\Program Files (x86)\Java\jdk1.6.0_18\bin

Note: if you change the SDK version, make sure to update the env. var. Path with the new Adobe SDK bin folder (this casued me 1 hour of grief)

7. Test that these work.

Open the Command Prompt window (or reopen to make sure changes have taken effect). Type javac to test the java path, and also adt to test the Adobe path. A list of usage options should appear for both.

Note: more on setting up the Air SDK and ADT environment variable in the Technology Documents blog.

8. Flex Builder 3 – Export Project

  • Click on Project in the Menu Bar, then Export Release Build.
  • Choose a location for the .air file to be exported to and hit next.
  • Create a new digital certificate, but do not store it in the Flex project folder, store it someplace else (I think you need this certificate file if you ever want to update the .air file, so keep it safe).

9. Run the ADT command:

Open the Command Prompt window and type the following.

adt -package -target native c:\AirExe\myApp.exe c:\AirExe\myAirApp.air

The myApp.exe is the EXE file you wish to create, and the myAirApp.air is the file you exported in Step 8.
More on the ADT commands at Adobe Help

10. Run the exe.

Run the generated exe file to install via a native Windows installer (this exe can also be packaged with other windows setup i.e. c#)

Air application and Air Runtime in a single setup.exe

I will be writing a tutorial shortly to show how to package an Air app along with the Air runtime in a single .exe using InstallJammer.

I have written a tutorial to show how to package an Air app along with the Air runtime in a single .exe using InstallJammer.

About these ads

Tags: , , , , , , , ,

37 Responses to “Adobe Air to Exe – Packaging Air app in Windows executable”

  1. selvam Says:

    ” Air runtime in a single .exe using InstallJammer”
    i am expecting this,
    is it possible to do the same using adt command

  2. Deploying AIR Application with AIR Runtime/Redistributable in Single Exe « Bishop On Development Says:

    [...] This is a follow-up from an article I wrote on packaging and AIR application as an EXE. [...]

  3. Jose Ignacio Hita Says:

    THANKS!!!!

    You saved me, this is exactly what I needed!!!

  4. Mariush T. – Freelance Flex/PureMVC Developer – blog » Blog Archive » AIR 2.0 Native Process with Java program Says:

    [...] Topics: Creating an AIR application using the command line tools Interacting with a native process Adobe Air to Exe – Packaging Air app in Windows executable Packaging an AIR application in a native installer Your First AIR 2.0 EXE file Adobe Flex & [...]

  5. Gary Oviatt Says:

    Good article. Up to this point I had not understood the role of the ADT program in creating an installable executable, nor where to find ADT.BAT.

  6. David Says:

    When I run the adt command like this
    adt -package -target native (path to where the exe file is to go) (path to the air file created ) it tells me
    “Signing options required to package from descriptor and fileset”
    If I then include -storetype pkcs12 -keystore certificate.p12 (where certificateis the path to my self signed cert) it the asks for a password but doesn’t allow me to put it in.
    To say I am confused is an understatement

    • bishoponvsto Says:

      I have’nt come accross that error before. Do you have different Flex SDK versions installed (check in C:\Program Files (x86)\Adobe\Flex Builder 3\sdks…). This was causing errors for me. Make sure the correct bin\adt in your PATH, and that FlexBuilder (if you use it) is compiling using the same SDK version.

  7. David Says:

    Thanks for that. My problem was spaces in the command prompt. Great tutorial by the way

  8. David Says:

    Can I just add (for those who have a similar problem) that apart from removing spaces in the command line,I did need to add signing options so my command line looked like

    adt -package -target native -storetype pkcs12 -keystore C:\Users\David\test_cert.p12 C:\Users\David\mytest.exe C:\Users\David\test.air

    When I ran this, the command prompt then asked for the certificate password but when you type in the password it doesn’t display and it looks like nothing has happened, but it has! I then navigated to where mytest.exe was supposed to be and it takes a few seconds for the file to write and display in the directory so be patient.

    • Sulaiman Says:

      can you tell me what the password is …. i reached the same position where it asked me for the password. what should i enter as the password./??

    • Sulaiman Says:

      C:\Users\David\test_cert.p12

      what is this all about .. can you please explain. ????

  9. Paul Morris Says:

    Worked like a charm. Thanks for the post.

  10. Ashok Says:

    Great article with steps detailed. Thank you; you saved me a couple of hours of frustration.

    On the signing thing; I created and used the certificate in Flash Builder (when you do the “Export Release Build”) and created the air file. I used this air file with adt; I did not get the message “certificate message” from adt. Note: You can create a certificate from flash builder (during “Export Release Build” process) and give the password for it.

  11. bishoponvsto Says:

    Just out of interest. What was the reason you folk had to convert the AIR file to an EXE?

    In my case it was to be packaged in an EXE that included a C#.Net application.

  12. Descreet Says:

    What do you think how can i solve my problem it’s same as this here.
    When i try to install my packed app. it shows me this error.

    “This application requires an update to Adobe AIR that is not available for your system.

    Please view the system requirements for Adobe AIR and update your system accordingly.”

    Any suggestion.?!

    • Brian Bishop Says:

      I think this might be a problem with Air 1.5… Which one are you using, maybe try the Air 2 beta download just to narrow down the problem. Are you using Linux?

  13. Kristen Says:

    Thanks for the steps! Going to try this later today and this should prove very helpful.

  14. Vishal Says:

    No working for me :(

    I tried every step but no help,

    I even downloded latest Adobe AIR 2 Release Candidate rc1 and changed the app descriptor to but still no help

    every time i run adt command i’m getting “-storetype is required” error

    i’m using flash cs4

    Pls help!! i want to create exe file of my .air urgently

    thnx

  15. Henry Mempin Says:

    Hi i am facing a problem when I’m issuing a command like this
    D:\temp>adt -package -storetype pkcs12 -keystore d:\hvm\henrymempin.p12 -target native d:\temp\librarysystem.exe librarysystem.air

    the error appear like this

    no such file d:\temp\librarysystem.exe

    what do i need to do, please help me?

    • bishoponvsto Says:

      Well

      You may need to specify the director for you librarysystem.air file like in the following:

      adt -package -target native c:\AirExe\myApp.exe c:\AirExe\myAirApp.air

  16. Arun Says:

    I experienced some issue while working with native application (exe) instead of air. I cannot update the application via auto updater. Do you have any idea, how to resolve this issue? Let me know please.

  17. Stephen Says:

    Has anyone been able to package their air app to a native installer via an ANT task? I have this working from the terminal going through Java seems to be throwing me all sorts of errors: http://forums.adobe.com/thread/698635

  18. Abhimanyu Lagishetti Says:

    Works perfect

    Thanks
    Abhi

  19. Chris Says:

    Hi, i take this mistake:
    Descriptor is invalid for native install. The namespace must be at least 2.0 and the app must support the profile extendedDesktop.

    I make my project with flex builder 3
    I update AIR & Java SDKs..
    Especcially, i download the Air Sdk 2.x and put it into the folder Flex Builder 3\sdks\3.0.0
    With this version of Air SDK i cannot export my application from with flex builder..
    I suspect that something i must change in this line of xml:

    but i don’t know what version i have…
    Any help?

  20. Phaninder Says:

    I am getting error while doing Export Release build.
    I am using versions as this
    Air -> 2.5
    Java -> 1.6
    Flex Builder -> 3.5

    When i am trying to create .air file , It is throwing error window like this
    “Error creating Air file:306:ERROR, desktop, mobileDevice, extendedMobileDevice, tv”.

  21. iced Says:

    Thanks a lot!! And the performance’s much better than things like swfkitpro
    Iced

  22. air tool Says:

    air tool…

    [...]Adobe Air to Exe – Packaging Air app in Windows executable « Bishop On Development[...]…

  23. rami Says:

    When i am trying to create .air file , It is throwing error window like this
    “Error creating Air file:306:ERROR, desktop, mobileDevice, extendedMobileDevice, tv”.

  24. bet2013.blog.com Says:

    This paragraph gives clear idea in favor of the new people
    of blogging, that really how to do blogging and site-building.

  25. Kitchenaid stand mixer Says:

    Hi there outstanding website! Dooes running a blokg similar to this take a lot of work?
    I’ve very little expertise in programming however I had beedn hoping
    to start my own blog soon. Anyway, should youu have any ideas or tips for new blog
    owners please share. I know this is off subject neverthelesss I
    simply needed to ask. Cheers!

  26. kopi luwak Says:

    I’d like to thank you for the efforts you’ve put in writing this website.
    I am hoping to check out the same high-grade content from you later on as
    well. In fact, your creative writing abilities has
    inspired me to get my very own website now ;)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

%d bloggers like this: