Adobe
Products
Acrobat
Creative Cloud
Creative Suite
Digital Marketing Suite
Digital Publishing Suite
Elements
Photoshop
Touch Apps
Student and Teacher Editions
More products
Solutions
Creative tools for business
Digital marketing
Digital media
Education
Financial services
Government
Web Experience Management
More solutions
Learning Help Downloads Company
Buy
Home use for personal and home office
Education for students, educators, and staff
Business for small and medium businesses
Licensing programs for businesses, schools, and government
Special offers
Search
 
Info Sign in
Welcome,
My cart
My orders My Adobe
My Adobe
My orders
My information
My preferences
My products and services
Sign out
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out My orders My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Review and Checkout
Adobe Developer Connection / Adobe AIR Developer Center /

Generating a Windows installer for your AIR captive runtime application

by Quentin Thiaucourt

Quentin Thiaucourt
  • toki-woki.net

Content

  • Exporting your AIR application with captive runtime
  • Packaging your application as a customized MSI file for Windows Installer
  • Where to go from here

Created

30 January 2012

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
Adobe AIR deployment desktop distribution localization

Requirements

Prerequisite knowledge

You need to know how to create a Flash Builder project and how to export it. You also need to know how to edit an XML file.

Additional required other products

  • WixEdit (free)
  • Learn more: wixedit.sourceforge.net
  • Download: sourceforge.net/projects/wixedit/files/wixedit/

User level

Intermediate

Required products

  • Flash Builder (Download trial)

With Adobe Flash Builder 4.6 and Flex 4.6, you now have the ability to bundle your AIR application with a captive runtime. In the past you could only deliver your applications as single AIR, EXE, or DMG files, all three of which relied on the AIR runtime to work.

In this tutorial, you'll learn how to take advantage of the new captive runtime feature and enhance it with a minimal and customized installation package for Windows Installer.

Note: This article only applies to Windows desktop applications. It does not apply to applications for Mac OS or mobile devices.

The captive runtime bundle produced by Flash Builder is a directory containing AIR runtime files and your applications (this is true for desktop apps; mobile apps are bundled differently). Here are the major benefits of this export mode:

  • Your application is runtime independent, so it can be installed without having to install the AIR runtime beforehand. This also means that the end-user will not be alerted in the case of AIR runtime updates.
  • Your application is easily portable (for example, when stored on a CD, a USB thumb drive, and so on)
  • Your application can be considered an all-in-one solution.
  1. Of course this mode also has drawbacks:
  • Your applications will not benefit from bug fixes or improvements in the AIR runtime.
  • Your application will not be as easy for you to distribute and for end users to install because there are multiple generated files stores in a directory.
  1. This tutorial is focused on the second drawback–specifically, on creating an installation package for Windows Installer to simplify the set up of an AIR application with captive runtime. To follow along you'll need Flash Builder 4.6 and WixEdit, as well as an AIR project ready to bundle.

Exporting your AIR application with captive runtime

Exporting your AIR application with captive runtime is simple:

  1. Once you have your AIR project ready for export, click the Export Release Build button in Flash Builder (or choose Project > Export Release Build).
  2. Type a directory name in as the Base Filename. This is where your exported files will be stored.
  3. In the Export Release Build dialog box, select Signed Application With Captive Runtime (see Figure 1).
  4. Click Next
Figure 1. Choosing the captive runtime option.
Figure 1. Choosing the captive runtime option.

You should be familiar with the remaining steps in the export process, so proceed as usual. Once the export is complete, the main difference with captive runtime is that you haven't created just one file, but rather a directory with files and subdirectories (see Figure 2).

Figure 2. Exported files.
Figure 2. Exported files.

If you double-click the newly generated EXE file, you'll notice that your application runs without having to be installed. Using it this way is perfect for some cases, but for other situations you may have a need to provide an installation process for your application. You can do that in a few minutes, through the MSI file format.

Packaging your application as a customized MSI file for Windows Installer

To create an MSI file you'll be using the WiX utility, but to make things easier you'll do it through WixEdit. You'll also be typing a few lines of XML.

WiX is short for Windows Installer XML. It is a toolset that uses an XML syntax to describe an installer's structure. Creating XML file and using the WiX command line tools is not always straightforward. To avoid this potentially heavy process you can download and install WixEdit, free software that provides a graphical user interface designed to ease the creation of WiX XML files and the invocation of WiX command line tools.

After you have downloaded, installed, and launched WixEdit, you'll see its startup screen (see Figure 3).

Figure 3. WixEdit's screen at launch.
Figure 3. WixEdit's screen at launch.

Creating a new WixEdit project

Start by creating a new file.

  1. Choose File > New.
Figure 4. The WixEdit wizard.
Figure 4. The WixEdit wizard.
  1. When the wizard opens (see Figure 4), click Next.

On the next screen, the wizard displays a tree control that you can use to specify where to deploy your AIR application files created by Flash Builder. Here, PFiles corresponds to the Windows Program Files directory; this is where you might want your application to be installed.

Figure 5. The wizard's Files and Folders screen.
Figure 5. The wizard's Files and Folders screen.
  1. Right-click PFiles and select Import Folder.
  2. Browse to the directory that Flash Builder created and select it (see Figure 6).
  3. Click OK.
Figure 6. Browsing for the build release folder.
Figure 6. Browsing for the build release folder.

You'll then see the selected directory and all its files under PFiles (see Figure 7).

Figure 7. The files and folders to install.
Figure 7. The files and folders to install.

Note: If you don't want to install directly in Program Files, you can create a directory tree. To do so, right-click Files and select New Folder. You can do this as many times as you want.

  1. Click Next.

The Select Features To Add screen (see Figure 8) lets you choose your installer features, here are the ones that I think are most useful:

  • Add Userinterface will allow users to see your setup process, this is pretty much mandatory.
  • Desktop Application Shortcut will create a shortcut to the application on the user's desktop.
  • Startmenu Application Shortcut will do the same, but in your user's Windows Start menu.
  • Startmenu Uninstall Shortcut will, similarly, add an uninstall shortcut on the Start menu.
Figure 8. Selecting features to add.
Figure 8. Selecting features to add.
  1. Click Next twice to choose your user interface type (see Figure 9).
Figure 9. Selecting a user interface.
Figure 9. Selecting a user interface.
  1. Select the Minimal interface, which is quite simple but typically enough for an AIR application.
  2. Click Next twice.
Figure 10. Creating the desktop application shortcut.
Figure 10. Creating the desktop application shortcut.

The Create Desktop Application Shortcut screen enables you to select the file to which the desktop shortcut will link (see Figure 10).

  1. Select the EXE file in the drop down list and type a label for the file that will be displayed in the shortcut.
  2. Click Next twice.
Figure 11. Creating the Start menu application shortcut.
Figure 11. Creating the Start menu application shortcut.

On the following screen (see Figure 11) you select the file to which the Start menu shortcut will link.

  1. As before, select the EXE file and type a label for the shortcut. You can also set the name of the directory that will hold the shortcut.
  2. Click Next twice.
Figure 12. Creating the Start menu uninstall shortcut.
Figure 12. Creating the Start menu uninstall shortcut.
  1. On the following screen type the name and description for the uninstall shortcut that will appear in your user's Start menu (see Figure 12).
  2. Click Next twice.
Figure 13. Setting product properties.
Figure 13. Setting product properties.
  • Next you will be prompted to customize some of your application's properties (see Figure 13):
  • Id: This GUID is generated automatically; leave it as is.
  • The language code: 1033 for English, 1036 for French. For more language codes, see http://wix.tramontana.co.hu/tutorial/user-interface/do-you-speak-english.
  • The manufacturer's (or publisher's) name: This should be you or your company.
  • The product name.
  • The identifier used for a potential update: This is also generated automatically; you can leave it as is.
  • The application's version.
  1. Edit the properties as needed and click Done.
  2. Choose File > Save to save your project (see Figure 14).
Figure 14. Saving your WixEdit project.
Figure 14. Saving your WixEdit project.

Fixing WixEdit file paths

A bug in WixEdit (or feature?) prevents it from storing your files' actual paths, you'll have to fix that manually.

  1. Choose Tools > Launch External Editor.

A WXS file will then open in Notepad (you can change this file association in WixEdit's settings).

  1. Replace Source=" with Source="C:\ in the file.
  2. Save your changes and return to WixEdit.

Of course if your files are not on your C drive, replace C with the letter of the drive they are on.

Setting your installer language

If you'd like your installer's dialog boxes to be in a language other than English you will have to change your project's compilation settings. To do so, follow these steps:

  1. Choose Build > Build Settings.
  2. Make sure Use Custom Commandline For Light.exe is selected.
  3. For French, type -cultures:fr-fr before –out (see Figure 15).
  4. Click OK.

For information on using other language, see http://wix.tramontana.co.hu/tutorial/user-interface/do-you-speak-english.

Figure 15. Edit build settings.
Figure 15. Edit build settings.

Removing or editing optional comments

WixEdit automatically adds optional meta-data (Comments and Description) under Product > Package (see Figure 16). You can simply delete them (by right-clicking and selecting Delete) or edit them.

Figure 16. Deleting the description.
Figure 16. Deleting the description.

Customizing the appearance

There are several ways of customizing the appearance of your installation package.

By default WixEdit shows a generic English license, and you may decide to show yours instead by declaring a variable in the WXS file's XML structure. To do so, open the file by choosing Tools > Launch External Editor and add this line after <UIRef Id="WixUI_Minimal" /> :

<WixVariable Id="WixUILicenseRtf" Value="C:\path\to\your\licence.rtf" />

Make sure to target an RTF file.

You can also customize the appearance using images. These images have to be BMP files and they have specific dimensions. The first one shows up in the first and last steps of your installer (see Figure 17).

Figure 17. The logo on the left is a custom image.
Figure 17. The logo on the left is a custom image.

To insert such an image, add this line after the license line:

<WixVariable Id="WixUIDialogBmp" Value="C:\path\to\your\image.bmp" />

This image has to be 493 × 312 pixels. It will be used as your installer's window background. Refer to the sample files for this article for an Adobe Illustrator template file to help you create your image.

The second image is used to customized your installer's top banner (see Figure 18).

Figure 18. Customized top banner image.
Figure 18. Customized top banner image.

You can add this image by inserting this line after the first image line:

<WixVariable Id="WixUIBannerBmp" Value="C:\chemin\vers\votre\image.bmp" />

This image has to be 493 × 58 pixels. The sample files for this article also contain an Illustrator template file to help you create it.

Automatically launching your application after installing it

If you want your application to automatically launch after the installation process you have to find its executable key inside the WXS file (look for desktopShortcut). When you have it, add these lines after the image lines:

<CustomAction Id="LaunchFile" FileKey="YOUR_EXECUTABLE_FILE_KEY" ExeCommand="" Return="asyncNoWait" /> <InstallExecuteSequence> <Custom Action="LaunchFile" After="InstallFinalize" /> </InstallExecuteSequence>

Building your MSI file

To create your MSI file, complete these steps:

  1. Complete your WXS edits, save your file, and return to WixEdit.
  2. Choose Build > Build MSI Setup Package and wait a few seconds.
  3. Make sure everything is OK by checking the Results Panel. You can safely ignore the potential "advertised shortcuts" warnings.

If it all went well you should see "Finished in x seconds" in the results and find some new files in the directory where you stored your WXS.

  1. To test your MSI file, choose Build > Install MSI Package.

That's it!

To uninstall your application from WixEdit, choose Build > Uninstall MSI Setup Package.

Your MSI file is in your WXS directory with an MSI extension. You can now easily share it and distribute your AIR application with captive runtime.

Where to go from here

Now that you've seen how easy it is to create a customized installer for your AIR application, you may want to read more about WiX and add new features to your installation package.


This work is licensed under a Creative Commons Attribution-Noncommercial 3.0 Unported License.

More Like This

  • Using Badger for Adobe AIR applications
  • Using Flash Builder 4.5 to package applications for Apple iOS devices
  • Getting started with the custom install badge
  • Packaging Adobe AIR applications for the desktop
  • Multiscreen development techniques with Flex and Adobe AIR
  • Creating your first Adobe AIR application on Android
  • Using Flash Builder 4.5 to package applications for Google Android devices
  • Updating Adobe AIR applications packaged with a native installer
  • Packaging Adobe AIR applications
  • Using Flash Builder 4.5 to package applications for BlackBerry Tablet OS devices

Tutorials and samples

Tutorials

  • Using the iOS Simulator to test and debug AIR applications
  • Using the Amazon In-App Purchase Adobe AIR native extension for Android and Kindle Fire
  • Transferring data with AIR native extensions for iOS – Part 3
  • Exchanging Vector and Array objects between ActionScript 3 and C, C++, or Objective-C

Samples

  • Licensing Adobe AIR applications on Android
  • Using web fonts with Adobe AIR 2.5
  • Using Badger for Adobe AIR applications

AIR blogs

More
07/09/2012 Protected: Publishing Adobe AIR 3.0 for TV on Reference Devices
07/08/2012 Source Code: Adobe AIR 3.3 Retina Video Application
07/06/2012 Application specific File Storage on Adobe AIR based ios Application
07/04/2012 Recent Work - iPad/Android App: Inside My toyota

AIR Cookbooks

More
02/09/2012 Using Camera with a MediaContainer instead of VideoDisplay
01/20/2012 Skinnable Transform Tool
01/18/2012 Recording webcam video & audio in a flv file on local drive
12/12/2011 Date calculations using 'out-of-the-box' functions

Products

  • Acrobat
  • Creative Cloud
  • Creative Suite
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Elements
  • Mobile Apps
  • Photoshop
  • Touch Apps
  • Student and Teacher Editions

Solutions

  • Digital marketing
  • Digital media
  • Web Experience Management

Industries

  • Education
  • Financial services
  • Government

Help

  • Product help centers
  • Orders and returns
  • Downloading and installing
  • My Adobe

Learning

  • Adobe Developer Connection
  • Adobe TV
  • Training and certification
  • Forums
  • Design Center

Ways to buy

  • For personal and home office
  • For students, educators, and staff
  • For small and medium businesses
  • For businesses, schools, and government
  • Special offers

Downloads

  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2012 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy Policy and Cookies (Updated)

Ad Choices

Reviewed by TRUSTe: site privacy statement