AIR 2.0 NativeProcess 不受支持问题

发布于 2024-09-07 14:25:04 字数 1054 浏览 9 评论 0原文

我构建了一个使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

月依秋水 2024-09-14 14:25:04

NativeProcess 仅在应用程序编译为本机二进制文件(而不是 .air 安装程序)时可用。

NativeProcess is only available when applications are compiled to native binaries, not .air installers.

还不是爱你 2024-09-14 14:25:04

您必须将supportedProfiles-tag设置为“extendedDesktop”才能使用本机进程。

在您的 app.xml 中放置/取消注释下面的这一行:

<supportedProfiles>extendedDesktop</supportedProfiles>

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:

<supportedProfiles>extendedDesktop</supportedProfiles>
爺獨霸怡葒院 2024-09-14 14:25:04

NativeProcess 可以用 Air2 编译,只是非常棘手。问题是你必须完全覆盖你的 Flex SDK 和新的 Air2。令人惊讶的是,根据 this链接,您不能通过查找器执行此操作,而应通过终端执行此操作。在 Mac 中:

  1. Air SDK 下载 SDK 并安装在文件夹 1 中。
  2. 复制 Flex SDK 并将其放在文件夹 2 中(在 Flex Builder sdks 文件夹中)。
  3. 在终端中写入 ditto -Vfolder1folder2 以覆盖它们。

现在转到项目的首选项并选择folder2作为sdk(现在它与folder1重叠)。

另外,您可能需要将描述更改为:

http://ns.adobe.com/air/application/2.0

在 Eclipse 中安装 Adob​​e 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:

  1. Download the SDK from Air SDK and put it in folder 1.
  2. Make a copy of your flex SDK and put it on folder 2 (in the flex Builder sdks folder)
  3. Write 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:

http://ns.adobe.com/air/application/2.0

There is very good description on Installing the Adobe AIR 2 SDK in Eclipse (check part 3).

Hope that helps.

乖乖哒 2024-09-14 14:25:04

解决了

使用本机签名而非 AIR 签名导出

Solved by

Export with native signed not AIR sign

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文