10

I have a mac application (Eg. Sample.pkg containing Sample.app) along with few pkg dependencies (Eg. A.pkg and B.pkg ). Whenever the user runs the dmg/product archive bundled with these three packages, A.pkg and B.pkg has to be run first before Sample.pkg is installed.

Is there a way where I can specify this dependency while packaging the mac application, without need the user to manually check and install them in the right order?

Marek R
  • 32,568
  • 6
  • 55
  • 140
Sumalatha Abhishek
  • 641
  • 1
  • 8
  • 16

1 Answers1

0

Solution

There is a way. You can add such entry to your 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>

This is documented here (required-bundles).

Some examples can be found on github.

Disadvantage

There is some bug in Apple Installer, required-bundles description says:

Attributes

|----------------|------------------|------------------------------------------------------------|
| 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.       |
|----------------|------------------|------------------------------------------------------------|

So the message from description should be shown, but I can't see it anywhere, so user can be confused why he is unable to install application.

It just warns: You can't install <your application> here, <your application> do not allow it. (sorry translation from my localization back to English).

Alternative

I've seen some installation package which was running custom script form installation-check invoking it from installation JavaScript, using system.run('script_name').

Marek R
  • 32,568
  • 6
  • 55
  • 140