如何使用productbuild构建具有自定义背景的OS X安装程序包? [英] How do I build an OS X installer package with a custom background with productbuild?
问题描述
我有一个项目,该项目依赖于现在不推荐使用的PackageMaker工具来创建OS X的安装程序.我正在努力将其更新为使用 productbuild .我正在尝试通过将--resources
标志传递到productbuild
并使用包含背景图片的目录来向安装程序添加自定义背景.我没有从productbuild
命令获得任何错误,但是当我在Pacifist中打开该程序包时,我完全看不到我的资源.我尝试在distribution.xml
中引用背景图像,但似乎没有什么不同.我不知道下一步该怎么调试.
I've got a project that relies on the now deprecated PackageMaker tool to create an installer for OS X. I'm working on updating it to use pkgbuild and productbuild. I'm trying to add a custom background to the installer by passing the --resources
flag to productbuild
with the directory containing the background image. I don't get any errors from the productbuild
command, but when I open the package in Pacifist, I don't see my resources included at all. I've tried referencing the background image in distribution.xml
, but it doesn't seem to make a difference. I'm at a loss for what to try next to debug this.
推荐答案
这是我的资源文件夹的样子:
This is what my resource folder looks like:
作为cmd参数,我使用:--resources /path/Resources
As cmd parameter I use: --resources /path/Resources
由于我没有使用PackageMaker GUI,并且我的安装程序工具从各个点开始手动创建了分发XML文件,所以只能说您必须指定此background.jpg文件,以便它最终出现在分发中XML文件为:
Since I'm not using the PackageMaker GUI and my installer tool creates the Distribution XML file manually from various bits and pieces, I can only say that you have to specify this background.jpg file so that it ends up in the Distribution XML file as:
<background file="background.jpg" alignment="topleft" scaling="none"/>
尽管该文件位于en.lproj文件夹中,也不应使用路径指定该文件.
Ie despite it being in the en.lproj folder the file should not be specified with a path.
这篇关于如何使用productbuild构建具有自定义背景的OS X安装程序包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!