如何在Mac上的dmg / pkg中包括安装程序依赖项

问题描述 投票:8回答:1

我有一个Mac应用程序(例如包含Sample.app的Sample.pkg)以及一些pkg依赖项(例如A.pkg和B.pkg)。每当用户运行与这三个软件包捆绑在一起的dmg/product存档时,在安装A.pkg之前必须首先运行B.pkgSample.pkg

打包Mac应用程序时,是否有一种方法可以指定此依赖关系,而无需用户手动按正确的顺序进行检查和安装?

macos installer dmg pkgbuild
1个回答
0
投票

解决方案

有一种方法。您可以将此类条目添加到distribution.xml

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<installer-gui-script minSpecVersion="1">
    <title>Application name</title>
    <organization>com.organization</organization>

    ....

    <volume-check>
        <required-bundles description="Some message which UI Installer doesn't show :(">

            <!-- bundle 1 -->
            <bundle id="com.organization.app1" path="Applications/App1.app" />

            <!-- bundle 2 -->
            <bundle id="com.organization.app2" path="Applications/App2.app" />
        </required-bundles>
    </volume-check>

    ....
</installer-gui-script>

此文档在(required-bundles)中记录。

某些示例可以是found on github

缺点

[Apple Installer中存在一些错误,required-bundles description说:

属性

|----------------|------------------|------------------------------------------------------------|
| Attribute name |       Type       |                       Description                          |
|----------------|------------------|------------------------------------------------------------|
|                |                  | _Optional._ Values: `true` (default) to require all of     |
|     `all`      |     Boolean      | the specified bundles, or `false` to require at least one  |
|                |                  | of them.                                                   |
|----------------|------------------|------------------------------------------------------------|
|  `description` |   String,        | _Optional._ A description of the required bundles,         |
|                | localization key | displayed to the user if the requirement is not met.       |
|----------------|------------------|------------------------------------------------------------|

所以应该显示description的消息,但我在任何地方都看不到它,因此用户困惑为什么他无法安装应用程序。

它只是警告:You can't install <your application> here, <your application> do not allow it.(对不起,翻译从我的本地化回到英语)。

替代

我已经看到一些安装包,该安装包正在运行自定义脚本格式installation-check,并使用system.run('script_name')从安装JavaScript调用它。

© www.soinside.com 2019 - 2024. All rights reserved.