我想在我的应用程序中包含一个命令。是否可以在AIR的工作目录中运行可执行文件?
答案 0 :(得分:0)
这有效:
var process = new NativeProcess();
var processInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
var path:String = File.applicationDirectory.nativePath;
var executable:File = new File(path + "/mycommand/mycommand");
processInfo.workingDirectory = File.applicationDirectory;
processInfo.arguments = ["-version"];
processInfo.executable = executable;
process.start(processInfo);