可移动媒体上的 .app OSX 软件包问题
因此,根据我对 Mac 打包的了解,我发现实际启动的程序是 Info.plist 中 CFBundleExecutable 键下定义的程序。
<key>CFBundleExecutable</key>
<string>JavaApplicationStub</string>
现在,如果 /APP/Content/MacOS/JavaApplicationStub 未 chmodded +x,我的应用程序将无法工作(它只是默默地失败而不执行任何操作,这很痛苦!)。 公平地说,我猜它是不可执行的。 但如果您从不支持文件上的 +x 属性的地方复制应用程序,这就是一个大问题; 例如 Windows、fat32 USB 密钥、CDROM、网站、zip 文件等...
在这些情况下我可以做什么以使应用程序能够运行? 手动设置执行位不是一个选项。
至少有人可以通过 CD 运行 Mac 应用程序!
So from what little I understand about packaging for Macs, I see that the actual program that launches is the one defined under the CFBundleExecutable key in Info.plist.
<key>CFBundleExecutable</key>
<string>JavaApplicationStub</string>
Now, my app doesnt work if /APP/Content/MacOS/JavaApplicationStub is not chmodded +x (It just fails silently without doing anything, which is a pain!).
Fair enough, its not executable I guess. But its a big problem if you are copying the app from somewhere that dosent support +x properties on files; such as windows, fat32 USB keys, CDROMs, websites, zip files, etc...
What can I do in these instances to make the app able to run? Manually setting the execute bit is not an option.
There's got to be people who run Mac apps off CD, at the very least!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为你唯一的选择是将APP捆绑包打包成DMG文件或tar。
DMG 更加标准,并且与使用 tar 或 zipping 一样容易。 我们使用的命令行是:
您可以从任何平台(甚至 Windows,如果您安装 cygwin,或使用 GNU 独立版本)进行 tar,http://gnuwin32.sourceforge.net/packages/gtar.htm)
使用 gzip 压缩:
I think your only option is to package the APP bundle into a DMG file, or tar.
DMG is more standard and just as easy to do as using tar or zipping. The command line we use is:
You can tar from any platform, (even Windows, if you install cygwin, or use the GNU standalone, http://gnuwin32.sourceforge.net/packages/gtar.htm)
With gzip compression:
@mxcl,有点效果,谢谢。 但是,您需要在 Mac 上运行 hdiutil :(。
另外,它弄乱了应用程序的路径...有些文件(如 db 文件)不在 .app 文件夹内,因此不包含在 .DMG 文件中。
我正在 Windows 上构建,并且该应用程序正在部署到可移动媒体。 重点是避免安装任何东西。
该应用程序也在 Windows 上运行,因此磁盘根目录下的 mac.app 旁边有一个 windows .exe。 还有一个两个版本的应用程序共享的 sqllite.db 文件。 多平台很难:/
@mxcl, that works, sort of, thanks. However, you need to be on a Mac to run hdiutil :(.
Also, it mucks up the paths of the app... there were some files(like the db file) that were not inside the .app folder, and thus are not included in the .DMG file.
Im building on windows, and the app is getting deployed to removable media. The whole point is to avoid installing anything.
The app runs on windows aswell, so there is a windows .exe alongside the mac.app on the root of the disk. There is also a sqllite.db file that both versions of the application share. Multi-platform is hard :/