AIR 2.0 NativeProcess 不受支持问题
我构建了一个使用 nativeProcess 打开 exe 的应用程序。
Flex Builder 3 中的应用程序运行时没有错误。
然后,当我在 .air 中导出应用程序 AIR 并将该应用程序安装在开发人员电脑或其他电脑中时,问题就出现了。
当我按下按钮打开 .exe 时,出现消息“不支持本机进程”。
我使用的 main.mxml 中的代码:
if (NativeProcess.isSupported)
{
var file:File = new File("app:/config/AbrirAplicacion.exe");
var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
nativeProcessStartupInfo.executable = file;
process = new NativeProcess();
process.start(nativeProcessStartupInfo);
process.standardInput.writeUTFBytes(textReceived.text+"\n");
process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
process.addEventListener(ProgressEvent.STANDARD_INPUT_PROGRESS, inputProgressListener);
}
else
{
textReceived.text = "NativeProcess not supported.";
}
对我做错了什么有什么想法吗?
I have built a application that use a nativeProcess to open exe.
The application into Flex Builder 3 run whitout errors.
Then the problem come when I export the aplicaction AIR in .air and install the applicaction in the developer pc or other pc.
When I push the button to open the .exe, appear the message "Native Process is not supported".
The code in the main.mxml that I use:
if (NativeProcess.isSupported)
{
var file:File = new File("app:/config/AbrirAplicacion.exe");
var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
nativeProcessStartupInfo.executable = file;
process = new NativeProcess();
process.start(nativeProcessStartupInfo);
process.standardInput.writeUTFBytes(textReceived.text+"\n");
process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
process.addEventListener(ProgressEvent.STANDARD_INPUT_PROGRESS, inputProgressListener);
}
else
{
textReceived.text = "NativeProcess not supported.";
}
Any ideas of what I'm doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
NativeProcess 仅在应用程序编译为本机二进制文件(而不是 .air 安装程序)时可用。
NativeProcess is only available when applications are compiled to native binaries, not .air installers.
您必须将supportedProfiles-tag设置为“extendedDesktop”才能使用本机进程。
在您的 app.xml 中放置/取消注释下面的这一行:
You have to set the supportedProfiles-tag to 'extendedDesktop' in order to work with Native Process.
Put / uncomment this line below in your app.xml:
NativeProcess 可以用 Air2 编译,只是非常棘手。问题是你必须完全覆盖你的 Flex SDK 和新的 Air2。令人惊讶的是,根据 this链接,您不能通过查找器执行此操作,而应通过终端执行此操作。在 Mac 中:
ditto -Vfolder1folder2
以覆盖它们。现在转到项目的首选项并选择folder2作为sdk(现在它与folder1重叠)。
另外,您可能需要将描述更改为:
在 Eclipse 中安装 Adobe AIR 2 SDK(请参阅第 3 部分)。
希望有帮助。
NativeProcess can be compiled with Air2 it's just very tricky. The problem is that you have to COMPLETLEY overlay your Flex SDK and the new Air2. Surprisingly, according to this link, you cannot do it through the finder and should do it through the terminal. In Mac:
ditto -V folder1 folder2
in the terminal to overlay them.Now go to your project's preferences and select the folder2 as sdk (now it's overlay with folder1).
Also, you will probably need to change the description to:
There is very good description on Installing the Adobe AIR 2 SDK in Eclipse (check part 3).
Hope that helps.
解决了
Solved by