Mac: How to add a License.txt file to pkg built with productbuild using the --component option?

We are currently creating our mac installer as a pkg file using productbuild --component (according to the following message: Mac app storebuild ).

This works great, but I also want to add the license file to this installer.

With packagemaker, you can specify the --resources [path_to_resources_file] option. If you place the License.txt file in the specified resource folder, the installer magically includes a license step.

While the -resources option is also described in the productbuild man page, in practice this does not work with the --component option. It just ignores the option at all.

According to the productbuild man page, the -component option apparently only uses the product definition layer (I looked at the plist options, and none of them apply to the license file), component, additional installation path and exit path. Although the -sign option also works.

Does anyone know if (and if so, how) it is possible to include a license file for the installer when using the productbuild component?

Thanks in advance.

Yane

+5
source share
1 answer

In your distribution file, which you pass as a parameter to productbuild, include the license element, for example:

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

These files must be present in any directory specified by the --resources parameter that you pass to productbuild, for example:

productbuild --distribution distribution.xml --resources building/ "Mac Installer.pkg"
+6
source

All Articles