javamacosapp-storeproductbuildpkg-file

productbuild --distribution : package xxx.pkg could not be loaded


I'm trying to package an application using the productbuild command to create a pkg file that will hold a license file. Here's how I'm doing it:

# Creates the first package  
productbuild --sign "3rd Party Mac Developer Installer: Tamaggo" --component tamaggo\ ibi.app /Applications/ tamaggoibi.pkg

# Creates a package that will hold the first one using a distribution file
productbuild --distribution tamaggo\ ibi.app/Contents/distribution.xml --package-path . --sign "3rd Party Mac Developer Installer: Tamaggo" bassel.pkg

I'm always getting the following warning:

productbuild: warning: package ./tamaggoibi.pkg could not be loaded

If i double-click on the first created package the installation completes successfully. If I double click on the other, nothing happen.

I just can't figure out what's wrong with the first package that makes it not loadable.

Here's the distribution.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN""http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<installer-gui-script minSpecVersion="1">
<title>tamaggo ibi</title>
<license file="license.html" />
<background file="ApplicationBackground.gif" />
<options customize="never" allow-external-scripts="no"/>
<choices-outline>
    <line choice="choice0"/>
</choices-outline>

<choice id="choice0" title="Install tamaggo ibi">
    <pkg-ref id="tamaggoibi" />
</choice>

<pkg-ref id="tamaggoibi" version="1.6">#tamaggoibi.pkg</pkg-ref>
</installer-gui-script>

Solution

  • Using pkgbuild fixed my original problem and I found this really good post that helped me to add the license to the installer.