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
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:
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:
(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.