I'm building an Air app that uses an .app/.exe file as a bridge to hardware devices.
Ideally, I would like to include the executable with the Air app installer and launch the external program together with the Air app.
1) Is this possible?
2) How do decide which OS specific file to launch?
EDIT: OK, the above wasn't very difficult:
var file:File = File.applicationDirectory;
file = file.resolvePath("src/assets/NativeApps");
if (Capabilities.os.toLowerCase().indexOf("win") > -1) {
file = file.resolvePath("Windows/echoTestWin.exe");
}
else if (Capabilities.os.toLowerCase().indexOf("mac") > -1) {
file = file.resolvePath("Mac/echoTestMac.app");
}
var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
nativeProcessStartupInfo.executable = file;
var process = new NativeProcess();
process.start(nativeProcessStartupInfo)
But why do I get this error message?
ArgumentError: Error #3214: NativeProcessStartupInfo.executable does not specify a valid executable file.
Isn't the .app extension valid?