I'm working on calling out to an external executable from the Adobe Air run time. The application is deployed as a native executable (.exe) from Air. Below is the code that I am using to generate the NativeProcess class and run the external call:
var file:File = File.applicationDirectory;
file = file.resolvePath("path to exe");
if(file.exists)
{
var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
nativeProcessStartupInfo.executable = file;
var procArgs:Vector.<String> = new Vector.<String>();
procArgs[0] = url;
procArgs[1] = contentType;
procArgs[2] = postData;
nativeProcessStartupInfo.arguments = procArgs;
_process = new NativeProcess();
try
{
_process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
_process.addEventListener(ProgressEvent.STANDARD_INPUT_PROGRESS, onOutputData);
_process.addEventListener(IOErrorEvent.STANDARD_OUTPUT_IO_ERROR, onIOError);
_process.addEventListener(IOErrorEvent.STANDARD_ERROR_IO_ERROR, onIOError);
trace("About to call external process");
_process.start(nativeProcessStartupInfo);
trace("Called external process");
}
The only way I get the executable to launch is by using a break point and running the application in debug.
I have set the <supportProfiles> tag in the application xml to be desktop extendedDesktop to allow the call to a native process.
The compiler is also set to deploy the exe into the application's directory structure.
I'm really struggling to understand what I could have set somewhere to get this to only fire in debug mode but not under normal circumstances in order to launch the process. Any suggestions would be greatly appreciated!