I am trying to create a Mac installer flat package using pkgbuild and productbuild and
that also includes an installer plugin.
I can build a package using pkgbuild, and build a distribution package using packagebuild,
but nothing I've done causes the installer package to display the plugin.
I've seen references to the plugin needing to be installed in the app's Contents directory,
and I know that the InstallerSections.plist needs to be there as well, but nothing seems
to work.
The documentation is very sparse, and in most cases written more than a few years ago, so
I suspect it's not very up to date.
I’ve been using the “Packages” tool – there is a problem with it, that building a package on Yosemite
that includes a plugin, the installer doesn’t work on prior versions (Mavericks or Mtn. Lion). It throws an exception
when installing on those OS’s.
Any suggestion as to what I'm doing wrong would be greatly appreciated.
-Mick
-------------
cat >Components.plist <<EOF
<?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">
<plist version="1.0">
<array>
<dict>
<key>BundleIsVersionChecked</key>
<true/>
<key>BundleOverwriteAction</key>
<string>upgrade</string>
<key>RootRelativeBundlePath</key>
<string>TestApplication.app</string>
</dict>
</array>
</plist>
EOF
pkgbuild --root ./build/Build/Products/Debug \
--identifier com.test.testinstall \
--version 1.2.3.4.5 \
--component-plist Components.plist \
--install-location /Applications \
dist/TestApplication.pkg
cat >Distribution.xml <<EOF
<?xml version="1.0" encoding="utf-8"?>
<installer-gui-script minSpecVersion="1">
<title>TestApp</title>
<pkg-ref id="com.test.installer"/>
<options customize="never" require-scripts="false"/>
<choices-outline>
<line choice="default">
<line choice="com.ntrepidcorp.passages"/>
</line>
</choices-outline>
<choice id="default"/>
<choice id="com.test.installer" visible="false">
<pkg-ref id="com.test.installer"/>
</choice>
<pkg-ref id="com.test.installer" version="0" _onConclusion_="none">TestApplication.pkg</pkg-ref>
</installer-gui-script>
EOF
productbuild --resources Resources \
--distribution Distribution.xml \
--package-path ./dist \
--plugins build/Build/Products/Debug/TestPlugin.bundle \
--sign "Developer ID Installer: Ntrepid Corporation (R9MT6WU6DE)" \
dist/TestPackage.pkg