Calendar

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

Tag Cloud

Categories

Archives

Recent Posts

Recent Comments


« AIR 2.0 Sample Applications | Main | Updating AIR 2.0 Flex 4 Apps »

Your First AIR 2.0 EXE file

By Rich Tretola | November 17, 2009
5,338 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 | 23 Comments »

23 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

  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…

  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 [...]

Comments