如何从构建脚本运行 packagemaker?
我有一个 Ant 脚本,它使用 JarBundler 任务将我的 Java 应用程序变成一个漂亮的 Mac Bundle。问题是我现在如何将其转换为 .pkg 文件以进行分发?
我正在考虑使用 packagemaker 命令行工具(位于 /Developer/usr/bin/packagemaker),但它有许多缺点:
- 如果我使用“--doc”选项将其指向 .pmdoc 文件(使用 PackageMaker GUI 构建)那么每当我将文件添加到项目中时,我都必须手动更改 .pmdoc 内容
- 如果我使用“--root”选项基于应用程序包构建包,那么我似乎不需要获取 GUI 的许多功能(例如包括许可证文本)。
其他人如何使用他们的构建脚本生成 .pkg 文件?
谢谢
I have an Ant script which turns my Java application into a nice Mac Bundle using the JarBundler task. The problem is how do I now turn that into a .pkg file for distribution?
I'm looking at using the packagemaker command line tool (located in /Developer/usr/bin/packagemaker) but it has a number of drawbacks:
- If I use the '--doc' option to point it to a .pmdoc file (built using the PackageMaker GUI) then I will have to manually change the .pmdoc contents whenever I add files to my project
- If I use the '--root' option to build the package based on the app bundle then it seems I don't get many of the features of the GUI (such as including the licence text).
How do other people produce a .pkg file with their build script?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我使用以下命令从
pmdoc
和包含 OS X 10.6 上的包的 DMG 构建包:I use the following to build a package from a
pmdoc
and the the DMG containing the package on OS X 10.6:我使用脚本自动更新 PackageMaker 文件的部分内容。我发现保留旧格式的
.pmproj
文件比切换到更新的捆绑包格式更方便。I use scripts to automatically update parts of the PackageMaker file. I found it more convenient to keep the old format
.pmproj
files rather than to switch to the more recent bundle format.您可以使用 packagemaker 的
--resources
选项将资源文件夹添加到包中。如果您正在构建旧式包(10.3,也许是 10.4 目标),您所需要做的就是放置具有适当名称的文件(例如(许可证,自述文件,欢迎)。(rtf | html)和背景。(jpg | gif|pdf|tif)) 可选择组织到 .lproj 子文件夹中,并且它们将包含 &由包使用。这似乎不适用于分发包(10.5 样式的扁平包和一些 10.4 包),因为资源文件名必须在分发文件中列出,并且我不确定如何使用 packagemaker 将它们放在那里。You can use packagemaker's
--resources
options to add a resources folder to the package. If you're building an older-style package (10.3 and maybe 10.4 target), all you need to do is put files with appropriate names (e.g. (License,ReadMe,Welcome).(rtf|html) and Background.(jpg|gif|pdf|tif)) optionally organized into .lproj subfolders, and they'll included & used by the package. This doesn't seem to work with distribution packages (10.5-style flat packages and some 10.4 packages), as the resource file names have to be listed in the distribution file, and I'm not sure how to put them there with packagemaker.