I would like to press a button from an Adobe AIR application and execute some installed program. For example, I would have a button named \"Start Winamp\". When this is pres
AIR 2.0 will have this capability.
It's expected to come out in beta by year end (2009) and ship first half of 2010.
http://blogs.adobe.com/air/2009/10/previewing_adobe_air_2_at_adob.html
Native process API Beginning with AIR 2, developers will have access to a native process API that will enable applications to invoke and communicate with native applications on the local machine. In order to preserve the cross platform nature of the .air file format, applications that take advantage of the native process API must be deployed as native installers such as .exe and .dmg. The AIR runtime SDK will include support for generating basic native installers.
Or simple my website create custom installer to new application read more
http://board.flashkit.com/board/showthread.php?834579-Embed-exe-file-from-swf-to-write-to-local-directory
Bonus Tip: We recommend you use Enigma Virtual Box because it is free and it is very good for Application Virtualization or Exe-Packer like BoxedApp Packer but it costs very much than Enigma Virtual Box Thanks!
Right now, there's no way to do this natively with AIR. There are some options, though:
I think FluorineFx does what you want: http://aperture.fluorinefx.com/?p=5
Another way of doing this is launching simple webserver on local machine (in background), and call it's methods using HTTPService.
The background webserver could be for example in python: http://fragments.turtlemeat.com/pythonwebserver.php
And it can launch executables and provide functionality that AIR cannot.
This keeps Flex code clean because it only implements REST interface and python (or other language) the rest of work. You can also benefit from using python as a interface to sqlite database or you can launch whole django as a webserver.
The only drawback is that the server must be already running on localhost .. and listening to some port (ie. 81). you can probably do this by launching the server on start of system.
It's not the best way but in some cases it could help your project as it did for me.
in mac os x, if you want to launch an .app file, then you have to write the following for the file path. (Assume that the name of the app is xxx)
if(NativeProcess.isSupported)
{
//not correct
//file = file.resolvePath("/Applications/xxx.app");
//correct
file = file.resolvePath("/Applications/xxx.app/Contents/MacOS/xxx");
var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
nativeProcessStartupInfo.executable = file;
var process:NativeProcess = new NativeProcess();
process.start(nativeProcessStartupInfo);
}