首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >mac:如何使用-- License.txt选项将组件添加到使用productbuild构建的pkg中?

mac:如何使用-- License.txt选项将组件添加到使用productbuild构建的pkg中?
EN

Stack Overflow用户
提问于 2012-08-14 21:34:16
回答 1查看 7.4K关注 0票数 7

我们目前使用productbuild --component (根据下面的帖子:Mac app store productbuild)将我们的mac安装程序构建为pkg文件。

这非常好用,但我也希望在此安装程序中添加一个许可证文件。

使用packagemaker,您可以指定选项--resources path_to_resources_file。如果您将一个License.txt放在指定的资源文件夹中,安装程序会神奇地包含一个许可步骤。

虽然productbuild的手册页也描述了--resources选项,但在实践中,这似乎不适用于--component选项。它似乎完全忽略了这个选项。

根据productbuild手册页,--component选项显然只接受产品定义plist (我查看了plist选项,似乎没有一个选项适用于许可证文件)、一个组件、一个可选的安装路径和一个输出路径。尽管--sign选项也可以使用。

有没有人知道在使用productbuild --component时,是否有可能(如果可能,如何包含安装程序的许可文件)?

提前谢谢。

Iain

EN

回答 1

Stack Overflow用户

发布于 2013-03-15 20:03:34

在您作为参数传递给productbuild的分发文件中,包含一个许可证元素,如下所示:

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>
<installer-gui-script minSpecVersion="1">
    <title>My Awesome App</title>
    <welcome file="welcome.html" />
    <readme file="readme.html" />
    <license file="license.html" />
    <conclusion file="conclusion.html" />

    <options customize="never" />
    <choices-outline>
        <line choice="install"/>
    </choices-outline>
    <choice id="install" visible="true" title="Install" description="Installation description goes here">
        <pkg-ref id="com.prosc.RemoteExecution.install.pkg">#installer.pkg</pkg-ref>
    </choice>
</installer-gui-script>

这些文件需要位于您在传递给productbuild的--resources参数中指定的任何目录中,如下所示:

代码语言:javascript
复制
productbuild --distribution distribution.xml --resources building/ "Mac Installer.pkg"
票数 9
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11953439

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档