加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

flash – 使用Adobe Air App捆绑并执行.app / .exe文件

发布时间:2020-12-15 07:24:49 所属栏目:百科 来源:网络整理
导读:我正在构建一个使用.app / .exe文件作为硬件设备桥接器的Air应用程序. 理想情况下,我希望将可执行文件包含在Air应用程序安装程序中,并与Air应用程序一起启动外部程序. 1)这可能吗? 2)如何确定要启动哪个操作系统特定文件? 编辑:好的,上面不是很难: var f
我正在构建一个使用.app / .exe文件作为硬件设备桥接器的Air应用程序.

理想情况下,我希望将可执行文件包含在Air应用程序安装程序中,并与Air应用程序一起启动外部程序.

1)这可能吗?
2)如何确定要启动哪个操作系统特定文件?

编辑:好的,上面不是很难:

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)

但为什么我会收到此错误消息?

ArgumentError: Error #3214: NativeProcessStartupInfo.executable does not specify a valid executable file.

.app扩展名不是有效的吗?

解决方法

.app实际上是一个文件夹.要访问内部的可执行文件,您必须引用YourApp.app/Contents/MacOS/YourApp

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读