I am creating an Air application that uses a .app / .exe file as a bridge for hardware devices.
Ideally, I would like to include an executable file with the Air application installer and run an external program with the Air application.
1) Is it possible?
2) How to decide which file of a particular OS to run?
EDIT: OK, the above was not 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 am I getting this error message?
ArgumentError: Error # 3214: NativeProcessStartupInfo.executable does not indicate a valid executable.
Is the .app extension true?
source share