在AIR的工作目录中运行可执行文件

时间:2019-05-01 02:49:51

标签: air

我想在我的应用程序中包含一个命令。是否可以在AIR的工作目录中运行可执行文件?

1 个答案:

答案 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);