Adobe AIR to execute program

airapache-flexcommandflash

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 pressed it should start Winamp.exe directly…I don't want some command line thing executed, I only want an exe to start. Or…is it the same thing ? Please, let me know if this is possible.

Thank you.

Best Answer

With AIR 2.0 you now can:

if(NativeProcess.isSupported)
{
    var file:File = File.desktopDirectory;
    file = file.resolvePath("StyleLookupold.exe");

    var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
    nativeProcessStartupInfo.executable = file;
    var process:NativeProcess = new NativeProcess();

    process.start(nativeProcessStartupInfo);

}

You also need to add this to your descriptor file.

<supportedProfiles>extendedDesktop</supportedProfiles> 
Related Topic