Deploying AIR Application and AIR Runtime (Redistributable) in Single Exe

引用于:
http://bishoponvsto.wordpress.com/2010/03/10/deploying-air-application-with-air-runtimeredistributable-in-single-exe/


Deploying AIR Application and AIR Runtime (Redistributable) in Single Exe
By bishoponvsto
In this article I show how to package an AIR application (.exe) with the AIR runtime redistributable in a setup file. Your end-users can then run a single setup.exe file to install both your app and the AIR runtime. Nice one!

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

What you’ll need:

The myApp.exe file you created from your myApp.air file (detailed in article mentioned above)
The Adobe Air 2.0 beta (or 2.0 beta 2) runtime exe file you’re currently using (can be downloaded here).
The free InstallJammer program (im using version 1.2.14)
1. You have to create a zip file containing the myApp.exe file and the Adobe Air Runtime Redistributable exe file.

Note: I firstly renamed the Air runtime file to air2runtime.exe (just for handiness), and called the zip file installFiles.zip

2. Install and open InstallJammer.

3. Choose File/New/Project Wizard. Enter a project name and destination folder for your InstallJammer project, I named mine Air Install Project, click next.

4. Enter some details for you apps’ name and version, next.

5. Step 4 asks for your Application Directory, where your air files are. I just leave this blank, and add my files later.

6. The next three steps are simple. Install wizard theme, os to install on (Windows for me), additional features (the default will do).

7. Next we want to add our zip file to the project.

Click on ‘Groups and Files’
Right click Program Files, and browse to your zip file (see pic below)

Groups and Files



8. Next we need to tell the installer how, when and where to unzip the files we created onto our end-users system.

Under Install User Interface on the left pane, click Install Panes and Actions.
Expand Action Groups in the right pane and expand Install Actions. Right click Install Actions and choose Insert Action/File Action/Unzip File. (see pic below)
Move the Unzip File box to position it just below Install Selected Files (see pic below Unzip Files – Advanced Properties)

Install Actions - Unzip File

Unzip File - Advanced Properties

9. Click on Unzip File and in the Advanced Properties panel on the lower right, change the Destination and Zip File dropdown box properties. I chose <%InstallDir%>/installFiles.zip, but you could choose <%Temp%>. See above pic.

This is something to play around with yourself (let me know if you hit any snags though, would be helpful to know)

10. Next we have to execute the Air Runtime file on our clients machine. Right click Install Actions and choose Insert Action/Execute Action/Execute External Program. Move ExecuteExternalProgram to just under Unzip Files (see next pic).

You will need to change the Execute External Program advanced properties, in this case the Program Command Line, set to air2runtime.exe, and the Working Directory (in my case changed to <%InstallDir%>/installFiles (its installFiles for me, but just use the name of you zip file without the .zip part).  Again, Temp instead of InstallDir would also do. See pic below for settings.

Execute External Program

11. Next step is to instruct the installer to execute the myApp.exe on the client machine.

For this repeat step 10, and place the ‘Execute External Program’ action just below the previous Air Runtime one. Change the Program Command Line to myApp.exe (or whatever you exe file is called).
Almost done!

Build the Install Project: All thats left to do is build the InstallJammer project by clicking Build (on top menu bar)/Build the Install.

You will find the ready to go Setup.exe file in the projects output folder, in my case: C:\Users\Brian\Documents\InstallJammer Projects\Air Install Project\output\Air Application-1.0-Setup.exe

This is the file your client/mate gets. Run you setup file……and hopefully nice one!


Install Screen

Problems/Comments 

Install location: Your app shortcut will probable be in Start/Programs, with an uninstall in the install directory.

Notice how the original 2 exe files are also in the install directory (this is why you may want to choose the Temp folder for unzipping).

Silent Install: Found details on doing a silent install of the Air runtime redistributable here. You use something like air2runtime.exe -silent -silent -eulaAccepted -desktopShortcut -programMenu, but I havent tried it.

Air Already Installed: If AIR Runtime is already installed, the runtime setup will tell you this.

Options: There are loads of options to choose from to customise you install, just browse through them in the Left Pane of InstallJammer.

Legal: Check out the Adobe website for any legal stuff (you probably ticked an ‘I Agree’ to certain terms to download the runtime anyhow). Adobe don’t want people to redistribute the runtime without a licence, but you can get a licence from here if you need.

你可能感兴趣的:(windows,wordpress,OS,Adobe,AIR)