可移动媒体上的 .app OSX 软件包问题

发布于 2024-07-07 19:12:50 字数 489 浏览 8 评论 0原文

因此,根据我对 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 技术交流群。

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

发布评论

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

评论(2

横笛休吹塞上声 2024-07-14 19:12:51

我认为你唯一的选择是将APP捆绑包打包成DMG文件或tar。

DMG 更加标准,并且与使用 tar 或 zipping 一样容易。 我们使用的命令行是:

hdiutil create -srcfolder Last.fm.app -format UDZO -imagekey zlib-level=9 -scrub Last.fm.dmg

您可以从任何平台(甚至 Windows,如果您安装 cygwin,或使用 GNU 独立版本)进行 tar,http://gnuwin32.sourceforge.net/packages/gtar.htm)

tar cf app.tar app_directory

使用 gzip 压缩:

tar czf app.tar.gz app_directory

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:

hdiutil create -srcfolder Last.fm.app -format UDZO -imagekey zlib-level=9 -scrub Last.fm.dmg

You can tar from any platform, (even Windows, if you install cygwin, or use the GNU standalone, http://gnuwin32.sourceforge.net/packages/gtar.htm)

tar cf app.tar app_directory

With gzip compression:

tar czf app.tar.gz app_directory
蓝天 2024-07-14 19:12:51

@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 :/

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