Search

 

November 2009
S M T W T F S
« Oct   Dec »
1234567
891011121314
15161718192021
22232425262728
2930  

Tags

Archives


« | Main | »

Your First AIR 2.0 EXE file

By Rich Tretola | November 17, 2009
26,617 views

Here is a very simple example of how to create your first installed exe for an AIR application. Here is what I did.

NOTE: Please make sure you have your application xml file set to:

1
<supportedProfiles>extendedDesktop desktop</supportedProfiles>
explorer

Using Flash Builder public beta with an updated Flex 4 SDK (overlayed with the new AIR 2.0 SDK), I created a simple application.

1
2
3
4
5
6
7
8
9
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                       xmlns:s="library://ns.adobe.com/flex/spark"
                       xmlns:mx="library://ns.adobe.com/flex/halo">
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:Label x="138" y="143" text="Hello World!" fontSize="36"/>
</s:WindowedApplication>

Next, I compiled the application at an AIR file by exporting the release build and self signing it.

Finally, I simply opened the console and ran the following command:

1
adt -package -target native C:\AIRSamples\AIRSample.exe C:\AIRSamples\AIRSample.air


console

Thats it, my AIRSample.exe was created.

Note: you could also have created a dmg or rpm:

1
2
adt -package -target native C:\AIRSamples\AIRSample.dmg C:\AIRSamples\AIRSample.air
adt -package -target native C:\AIRSamples\AIRSample.rpm C:\AIRSamples\AIRSample.air

Here is what the install process looks like for the exe.

installer


helloworldrunning

Topics: Adobe AIR | 36 Comments »

36 Responses to “Your First AIR 2.0 EXE file”

  1. Christian Cantrell Says:
    November 17th, 2009 at 10:29 am

    Thanks for getting a sample up so quickly! What do you think of AIR 2 so far? Got any big plans for apps?

    Christian

    Reply to this comment

    Rich Tretola Reply:

    No problem, I had to wait until today. :-)

    As far as apps, not sure yet but we certainly have a lot more possibilities now.

    Reply to this comment

  2. Remi.T Says:
    November 17th, 2009 at 11:26 am

    Thanks too for this post.

    The install screen doesn’t look like the default air install screen. I was wondering if it can be customized ?

    Reply to this comment

  3. achraf Says:
    November 17th, 2009 at 10:08 pm

    hi,

    i follow all off these steps and when i launch the command like, i have this error message (ava[2588:c0b] Can’t open input server /Library/InputManagers/SafariStand4.0L167).
    I am on Mac osx leopard.

    i type this in command like adt -package -target native /airApp/main.app /airApp/main.air

    do you have any idea ??!!!

    Reply to this comment

    Rich Tretola Reply:

    Your command is incorrect, the -target native should be either an exe, dmg, or rmp.

    Reply to this comment

  4. uberVU - social comments Says:
    November 17th, 2009 at 10:43 pm

    Social comments and analytics for this post…

    This post was mentioned on Twitter by CreativeTweet: Adobe AIR News: Your First AIR 2.0 EXE file: url=’http://blog.everythingflex.com/2009/11/17/your-first-air-2-0-exe-… http://bit.ly/1vi0gY...

  5. Tweets that mention Your First AIR 2.0 EXE file | EverythingFlex: Flex & AIR -- Topsy.com Says:
    November 18th, 2009 at 5:03 am

    [...] This post was mentioned on Twitter by Scott Knutti and Heiko Dreyer, Flex Monster Team. Flex Monster Team said: Your First AIR 2.0 EXE file http://bit.ly/15a5kq (via @richtretola) [...]

  6. Nikola Says:
    November 18th, 2009 at 9:42 am

    Hello,

    I’ve tried the command, but I have problem. I can’t access (recognize) the adt! How to solve this?

    And what about the shortcut menu option (convert to .exe) if you right click the air file?

    Thanks in advance,
    Nikola

    Reply to this comment

    Nikola Reply:

    I solved it!

    Reply to this comment

    mukesh gupta Reply:

    How, I need the helo to solve the same issue on Windows 7 machine

    Reply to this comment

  7. Martin Arvisais, As-Is - Développeur et Formateur Adobe Flash - Flex - FMS - Actionscript 3.0 - AIR - Web - Internet :: Flash :: Beta du Adobe flash player 10.1 et Adobe AIR 2 disponible Says:
    November 18th, 2009 at 8:59 pm

    [...] http://www.insideria.com/2009/11/udp-socket-connections-for-los-1.html http://blog.everythingflex.com/2009/11/17/your-first-air-2-0-exe-file/ http://flanture.blogspot.com/2009/11/simple-transparent-air-desktop-thing.html [...]

  8. AIR 2.0 Native Installer Concerns | EverythingFlex: Flex & AIR Says:
    November 19th, 2009 at 8:42 am

    [...] Your First AIR 2.0 EXE file [...]

  9. Ajith Says:
    December 7th, 2009 at 12:17 am

    Hi,

    I’ve tried the command ( adt -package -target native C:\sampleapp.exe C:\sampleapp.air ) in cmd, but I am getting an error message (‘adt’ is not recognized as an internal or external command).

    Then I tried the same command with ‘Adobe Flash Builder Beta 2 SDK Command Prompt’,but i am getting the error message (-storetype is required).

    Please tell me how to solve this issue?

    Thanks,
    Ajith Kumar R

    Reply to this comment

    Rich Tretola Reply:

    This means that you do not have the SDK added to your classpath correctly.

    Reply to this comment

    Ajith Reply:

    Hi Rich Tretola,

    Setting the classpath solved the issue.
    Thank you very much..:)

    Reply to this comment

  10. mukesh Says:
    December 7th, 2009 at 5:41 am

    Hi,Thanks for the code. But I got the error “storetype is required.” I do not how to solve that, do u have any idea to solve that.I am using Flash4 builder with AIR version 1.5.2.

    Reply to this comment

    Rich Tretola Reply:

    This only works with AIR 2.0. You need to upgrade your SDK and then overlay the Flex SDK with the AIR 2.0 SDK.

    Reply to this comment

  11. mbt shoes Says:
    December 23rd, 2009 at 10:43 pm

    Mbt sale there,Would you want to experience the wonderful feeling in Mbt m walk shoes or Mbt chapa shoes?
    http://www.discountmbt.com/

    Reply to this comment

  12. ajith Says:
    January 28th, 2010 at 8:06 am

    Hi,

    I got an error when i tried to build air file.Error message given below:

    “Error creating AIR file: 306: ERROR, desktop, mobile Device, or extended MobileDevice”

    Please help me.

    Thanks,
    Ajith Kumar R

    Reply to this comment

    john barrie Reply:

    “Error creating AIR file: 306: ERROR, desktop, mobile Device, or extended MobileDevice”

    I also got this message while creating the .air !

    Did you find a solution for this ?

    if the “supportedProfiles” tag is removed I can export fine. Of course this means that the “nativeProcess” nolonger works. ;) But it does give some indication to the source of the problem.

    Reply to this comment

    Rich Tretola Reply:

    Make sure you have your supportedProfiles set to:

    <supportedProfiles>extendedDesktop desktop</supportedProfiles>

    Reply to this comment

    ajith Reply:

    Hi,

    Thank for the reply,now it works fine…

    jonnyp Reply:

    When I do this it doesn’t allow nativeProcess calls to work at all. What’s the deal?

    Pontus H Reply:

    If I put extendedDesktop desktop in the -app.xml file, NativeProcesses are disabled. How do I solve this?

    Im using Adobe Flash Builder 4.0.1

    Best regards
    / Pontus

  13. Mitesh Says:
    February 15th, 2010 at 9:31 am

    Hi,
    very nice example thanks for that.But i am facing only one problem whenever i execute the adt -package -target ////

    i get signing options required to package from descriptor and file set. please help me i will be thankful to you

    Reply to this comment

  14. Adobe Air 2(Beta 2) to Exe – Packaging Air app in Windows executable « Bishop On Development Says:
    February 23rd, 2010 at 12:44 pm

    [...] 1-4 above are covered very nicely in Rich Tretola’s Everything Flex blog, but has less emphasis on errors. The following steps will show you how to set up the environment [...]

  15. David Says:
    March 23rd, 2010 at 6:36 pm

    I am the same as Mitesh in that I get signing options required to package from descriptor and file set when I run the adt command

    Reply to this comment

  16. Brian Says:
    March 24th, 2010 at 6:37 pm

    David (from the post above) found a solution to the signing problem that Mitesh was having (and that I sometimes get, although I dont know why). Here is the comment he put on my blog:

    Quote: 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

    Thanks Dave

    Reply to this comment

  17. wedding dresses Says:
    March 29th, 2010 at 11:49 pm

    welcome to buy wedding dresses
    free shipping ,fashion style ,cheaper price
    http://www.wedding-dresses-mall.com

    Reply to this comment

  18. ED Hardy Jeans Says:
    March 31st, 2010 at 4:27 am

    welcome to http://www.aj-wholesale.com/category-101-b0-ED+Hardy+Jeans.html

    Reply to this comment

  19. Mohit Says:
    August 10th, 2010 at 6:35 am

    Hi,

    I create a dmg package using ” adt -package -target native C:\AIRSamples\AIRSample.dmg C:\AIRSamples\AIRSample.air ” command but when i open this into mac it gives me messgae that not recognize all time,

    Can you please help me ?

    Thanks
    Mohit

    Reply to this comment

    Mudasir Reply:

    You’ve to create .dmg package in Mac. you can’t create package of other OS in Windows.

    Reply to this comment

  20. Gourav Says:
    August 12th, 2010 at 3:25 am

    Hi,
    i want to convert my .air to .exe
    i try same process and also write this like to my xml
    desktop extendedDesktop
    and im using air2 so i write:

    but when write
    “adt -package -target native C:\AirExe\AirinstallerDemo1.0.dmg C:\AirExe\AirinstallerDemo1.0.air”
    to command prompt i got the fallowing error:
    ————————————————————————————
    -storetype is required
    usage:
    adt -checkstore SINGIN_OPTIONS
    adt – certificate ……..
    adt -help

    .
    .

    adt -version
    SINGIN_OPTIONS : – stroretype (- )?……….
    …….
    …….
    *
    ———————————————————–

    Reply to this comment

    mukesh gupta Reply:

    -Same issue for me also.

    Reply to this comment

    Mitesh Dave Reply:

    Please Refer this site for additional help mukesh.it will certainly help you :)
    http://bishoponvsto.wordpress.com/2010/02/23/adobe-air-2beta-2-to-exe-packaging-air-app-in-windows-executable/

    Reply to this comment

  21. Matt Houseman Says:
    March 18th, 2011 at 10:07 pm

    All,

    I totally get how to create an installer like so:

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

    Is it possible to run the installer silently from the command line? Part of our smoke test process is to do nightly builds which would include the adt command above. What we’re missing right now is automatically copying the installer to a QA machine and silently install from the command line. Currently, we have a QA engineer manually running the GUI installer.

    We want to automate as much of our process as possible and without installing silently from the command line, we’re kind of dead in the water for automating this process. Thanks…

    Matt

    Reply to this comment

Comments