我试图为OS X 10.9+创建一个xulrunner应用程序。我需要它是独立的,即不需要任何额外的附加软件(包括Firefox)与应用程序一起安装在盒子上。
我无法谷歌了解如何做到这一点的最新指南。我似乎已经点击了此处描述的每个问题:https://bugzilla.mozilla.org/show_bug.cgi?id=923979
最后一个是:
$ open MyApp.app LSOpenURLsWithRole() failed with error -10810 for the file /Path/To/MyApp.app.
这是我到目前为止所拥有的:
https://drive.google.com/file/d/0BxRquYs2Nx92ZTZaVjk0QThMN2c/view?usp=sharing
如何为现代(v36 +)xulrunner应用程序创建OS X .app?
答案 0 :(得分:4)
你走在正确的轨道上,只有一个主要问题。
如果你是通过命令行运行应用程序,你会得到一些像这样的输出。
$ SampleApplication.app/Contents/MacOS/xulrunner
Mozilla XULRunner 33.0
Usage: xulrunner [OPTIONS]
xulrunner APP-FILE [APP-OPTIONS...]
OPTIONS
--app specify APP-FILE (optional)
-h, --help show this message
-v, --version show version
--gre-version print the GRE version string on stdout
APP-FILE
Application initialization file.
APP-OPTIONS
Application specific options
正如我们所看到的,可执行文件没有像教程所说的那样自动运行Contents/Resources/application.ini
。这是一个已知问题,XULRunner用户的流行解决方法是创建一个stub shell脚本,将所需的参数传递给xulrunner
二进制文件。
这是一个我正在努力做到的脚本。
#!/bin/sh
runpath="`dirname "$0"`"
contentsdir="`cd "$runpath"/.. > /dev/null && pwd`"
exec "$runpath/xulrunner" --app "$contentsdir/Resources/application.ini"
将此文本保存到MacOS
目录中的文件,并为其授予可执行权限。为了举例,我将使用sampleapplication
。以下是设置可执行权限的命令。
chmod +x sampleapplication
现在,修改Info.plist
以执行此脚本,而不是直接执行xulrunner
,方法是设置CFBundleExecutable
条目以匹配您的stub shell脚本。
<key>CFBundleExecutable</key>
<string>sampleapplication</string>
现在,当您运行应用程序时,它应该可以正常运行。如果您收到错误说&#34; The application cannot be opened because its executable is missing&#34;,您可能需要重命名应用程序包,或者按照该问题中的建议来避免缓存问题。
您可以删除Contents/Frameworks/XUL.framework
目录,it is no longer used和placing the XUL.framework contents in the MacOS folder is now the correct place to put them。
您还应该将dependentlibs.list
文件从Contents/MacOS
复制到Contents/Resources
目录,尽管如果没有它,XULRunner 33似乎正常。