Package Adobe Air to Exe - actionscript-3

Using Flash Builder 4.6, I exported an Adobe Air file from my mobile project.
I'm trying to get it packaged into an EXE (that would include the Adobe Air Runtime)
The project was compiled with Air 3.1. I looked online and there are some ADT commands that people recommend using but the problem is that the command throws errors in Air 3.1
If i use air 3.0 ADT:
AIR file at [app path]/app.air could not be converted.
The error was ""
If I use air 3.1 or air 3.2 sdk
SDK is missing file [my path to air]\lib\nai\bin\naip.exe
I'm running
java -jar [path to air]\lib\adt.jar" -package -target native app.dmg app.air
I've also tried
java -jar [path to air]\lib\adt.jar" -package -target native app.exe app.air
I've also looked into projects like this one: http://bishoponvsto.wordpress.com/2010/02/23/adobe-air-2beta-2-to-exe-packaging-air-app-in-windows-executable/ , but it is for Air 2.0.
Any ideas? Apparently there is an integrated Flash Builder 4.6 tool, but for some reason the option under export release doesn't exist for mobile projects - strange...

Why do you want to do this? Air files -- when exported for a specific platform -- are executables.
If you are looking for an "installer" that will create directories, run the Air installation, and move auxiliary files to specific locations (docs, icons, etc.), then try Inno Setup.
EDIT:
The code you provided works for me to create a Windows EXE. But it seems a bit unecessary . . . why not just export the EXE file from Flash Builder ("Export Release Build" button in the top toolbar)? If you can't or won't, then here are some suggestions:
I am using Java version 1.6.0_29. Make sure your Java is not only up to date, but that you are actually calling the correct version (java -version).
Check the JAR directory text carefully .
Check that you are actually calling to the right Air version.
Make sure that the quotation marks are on both sides of the JAR path.
You should be able to do a "Export Release Build" (though I am using FB 4.5). Instead of selecting "Export as: Signed packages for each target platform", select "Export as: Signed AIR packages for installation on the desktop". (You may have to create a certificate, but you can create one through this export feature, too.)
(If you happen to be able to use the Flash IDE, the exported Air file has to support both "Desktop" and "Extended Desktop".)
Hopefully, this will allow you to both produce an Air program that can be converted to EXE, and actually convert it using the command line.

I know this question is a little old, but a co-worker just ran into the same error message using the command line tools and FlashDevelop. It turns out that he was accidentally packaging some source files into the .air package, an extra copy of the app descriptor and one of the swc's was getting packaged in the .air file. I removed those and repackaged the .air file, then used this command:
adt.bat -package -target bundle kiosk kiosk.air
This successfully created a captive runtime exe. Of course there's no need to create a .air file first, you can package right to native or captive runtime, but since my co-worker was creating .air files I did it that way too just to be sure it would work.

Related

How to change version of application in air package?

I need to change version of air package from 1.1.0 to 1.2.0, without having it's source codes.
I've tried to extract .air package with winRar, and changing the META-INF\AIR\application.xml file, then after archiving it back to .air package, install it, but it gives me an error - "package cannot be install, try to get new file".
Any ideas how to change information in .air file? OR how to make auto update to older version of application?
Every AIR application requires an application descriptor file. The application descriptor file is an XML document that defines the basic properties of the application.
Open your -app.xml in your adobe air application project and change value in version tag
<versionNumber>0.0.0</versionNumber>

Compiling sqlite-winrt for using SQL in WinRT/WP app with SQLite

I'm trying to use the sqlite-winrt library at https://sqlwinrt.codeplex.com (cf. http://blogs.windows.com/windows_phone/b/wpdev/archive/2013/05/30/sqlite-winrt-wrapper-for-windows-phone.aspx) because I need to access an SQLite database via SQL commands in a WinRT 8.1 and a WP8 app and this library seems the only available option.
Anyway, there is no binary release and if I try compiling the source I get several link errors for unresolved externals against the SQLite DLL. I posted an issue at codeplex but got no reply yet, so I was wondering if anyone had already managed to successfully compile this lib and how (or if you know of any viable alternative for RT8.1 and WP8). Here is what I did:
downloaded the latest source from the site.
downloaded and installed 2 VSIX from http://www.sqlite.org/download.html: sqlite-winrt81-3080002.vsix for RT 8.1 and sqlite-wp80-winrt-3080100.vsix for WP.
executed the powershell scripts in each subfolder of the source code solution, which are required to update the projects with newer releases of the SQLite for WinRT extension. The current versions of the scripts refer to SQLite for WinRT 8.1 (prerelease) which is the same I downloaded above.
opened the VS2013 solution and removed the RT project (I just need RT8.1 and WP, this was for WinRT 8.0).
5) built the solution, which failed with link errors.
If I see the RT8.1 project properties, I can confirm the reference to SQLite is under C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1\ExtensionSDKs\SQLite.WinRT81\3.8.0.2.
Did anyone manage to use this lib? Thanks!
I also once had that problem. I fix it by editing the project file manually. At that time, the powershell script updating the wrong path. That's why I always failed when compiling my project. After I edit the project file using external text editor (I use sublime text), the projects are linked correctly.
You can try DatabasesCx. It is another SQLite Wrapper using Windows Runtime Component technology. It is freeware distributed as precompiled binary. You can find the details at http://www.almanacsoft.com/databasescx

Adobe AIR - .air to .exe/.dmg/.rpm

I need to get a native installer for Mac and Linux from an .air file. I'm on Windows and using AIR 2.5 .
I came across this interesting Windows application to convert an .air file to .exe/.dmg/.rpm.
I can not get it to work so did somebody else used it and can proof the functionality or can recommend a similiar app?
Thanks.
Uli
Here is an article from adobe to accomplish what you're trying to do here:
http://help.adobe.com/en_US/air/build/WS789ea67d3e73a8b22388411123785d839c-8000.html
I'm not sure if there are other applications that automate this process for you. There were a couple back when this functionality was first in beta but I think they're pretty much gone or incompatible. See here for a tutorial:
http://bishoponvsto.wordpress.com/2010/02/23/adobe-air-2beta-2-to-exe-packaging-air-app-in-windows-executable/
From the Air docs: "You must use ADT on the same operating system as that of the native installer file you want to generate."
I develop on a Mac and run Windows via bootcamp and with this setup I've been able to create native installers for both operating systems. Also it's worth noting that Adobe has abandoned support for Linux as for v2.6 so this may influence to what amount of trouble you're willing to go through to build an .rpm
you should use adt command.
adt -package -target native myApp.dmg myApp.air for MAC
and
adt -package -target native myApp.exe myApp.air fr Windows
Why not take a look at this article on NativeProcess functionality, it describes the process of creating a native installer. To quote some relevant portions:
To package the application, invoke the ADT application using syntax to package a native installer application version.
You must run ADT on the same operating system as the target installer application. To generate a DMG file, run ADT on Mac OS. To generate an EXE installer file, run ADT on Windows.
For example, the following command packages a DMG file on Mac OS:
adt -package -storetype pkcs12 -keystore myCert.p12 -target native NativeProcessTest.dmg NativeProcessTest-app.xml NativeProcessTest.swf NativeApps/Mac/bin/echoTestMac icons
Before running this command, open the Terminal application and navigate to the output directory for your Flex project. Adjust the following:
The path to the ADT application in the Flex SDK
The name and path of the signing certificate (given as myCert.p12 in this example)
For example, the following command packages an EXE installer file on Windows:
adt -package -storetype pkcs12 -keystore myCert.p12 -target native NativeProcessTest.exe NativeProcessTest-app.xml NativeProcessTest.swf NativeApps/Windows/bin/echoTestWindows icons
Before running this command, open a command line session and navigate to the output directory for your Flex project. Adjust the following:
The path to the ADT application in the Flex SDK
The name and path of the signing certificate (given as myCert.p12 in this example)
For more information on using ADT and on using signing certificates, refer to "Packaging an AIR application in a native installer" in Building Adobe AIR applications.
Captive Runtime will do something similar, but requires AIR 3 or later.

How to ensure that paths for executables are added to path for Adobe AIR application?

I wok on desktop Adobe AIR application. It creates .DMG for mac os builds. It is actually command line application. What I want is the ability to call it from command line - add it .../*.app/Content/MacOS to $PATH. Is there any standard way to do it with AIR ? I need it to work on Windows as well.
Thanks!
No standard way, that's for sure. It's out of scope of AIR. You probably should do that with the shell - something like SET %PATH% = %PATH% + ... Assuming your AIR application has access to shell interpreter, it can do it on first run right after install.

Run AIR app without AIR runtime files

I've made an AIR app with Flash Builder 4. Works great but I want to run the app without installing it. So..... when I install the app, I copy the files from program files and paste it on a CD and give it to somebody. He runs it on another computer without AIR runtime with as result that it doesn't work.
How can I bypass this? Like some launcher/setup that installs AIR runtime for the client if it aint installed. If it is installed, run the AIR app.
Thanks.
Creating an AIR Badge would be a good option.
The idea is you pass a link to the client, the AIR Badge check if
AIR is installed. If it is, installs your app, otherwise installs AIR
first.
There's a pretty good AIR Badger tutorial on the Adobe Developer Connection site. AIR Badger is an AIR App Grant Skinner wrote to make the setup easier.
Also check out the new AIR Launchpad, which is another AIR app that helps you get started with all sort of AIR related functions, including install badge.
Unfortunately the AIR Badger works online.
You cannot bypass AIR install. Maybe have a third party utility(batch script/etc.) that looks for air related files/.air filetype associations and based on that launches an AIR installer you supply on CD or the app itself.
On osx you have the mdls command that displays information about a file. You could check for kMDItemKind:
mdls -name kMDItemKind /path/to/yourApp.air
If it prints "com.adobe.air.InstallerPackage", then air should be installed, otherwise it will just print "Document".
There should be something similar for windows command prompt that checks registry file type associations.
After you've done that check, install AIR first or just the app, depending on the result.
HTH