VST Installer?

I would strongly recommend learning PackageBuilder. In the last few years, Packages has failed to update with a major macOS change at least twice (most recently with High Sierra) and several months have gone by before he has released a new build. Obviously, in a production scenario, that’s not going to work. It is a labor of love (or, you know, the opposite of that most likely) for him, so it will end at some point.

I’m sharing my normal PackageBuilder script here. I’ve edited out sensitive info. The tree looks like this:

/myScriptFolder/myScriptname.command
/myScriptFolder/Distribution.xml
/myScriptFolder/Resources/background.png //1247 x 840 png
/myScriptFolder/Resources/en.lproj/license.rtf // your EULA
/myScriptFolder/Resources/en.lproj/welcome.rtf // the text that goes on the first page of the installer
/myScriptFolder/Resources/en.lproj/Localizable.strings

That’s the tree, in its entirety. Now the script itself. Make a text file named myScriptname.command, and put this in it, and edit to to fit your scheme. I’ve edited the AAX signing line because it contains sensitive info, but otherwise left everything else intact.

name="Discord4"
version="4.0.1"

mkdir aax/
cp -R "/Library/Application Support/Avid/Audio/Plug-Ins/${name}.aaxplugin" aax

mkdir au/
cp -R "/Library/Audio/Plug-Ins/Components/${name}.component" au

mkdir vst/
cp -R "/Library/Audio/Plug-Ins/VST/Audio Damage/${name}.vst" vst

mkdir vst3/
cp -R "/Library/Audio/Plug-Ins/VST3/${name}.vst3" vst3

/Applications/PACEAntiPiracy/Eden/Fusion/Versions/3/bin/wraptool sign --verbose --account XXXXX --password XXXXX --wcguid XXXX-XXX-XXX-XXXX --signid "Developer ID Application: Audio Damage, Inc. (XXXXXXX)" --in "./aax/Discord4.aaxplugin"

pkgbuild --analyze --root "./vst/" "${name}_VST.plist" \

pkgbuild --analyze --root "./vst3/" "${name}_VST3.plist" \

pkgbuild --analyze --root "./au/" "${name}_AU.plist" \

pkgbuild --analyze --root "./aax/" "${name}_AAX.plist" \

pkgbuild --root "./vst/" --component-plist "./${name}_VST.plist" --identifier "com.audiodamage.pkg.VST" --version $version --install-location "/Library/Audio/Plug-Ins/VST/Audio Damage" "${name}_VST.pkg"

pkgbuild --root "./vst3/" --component-plist "./${name}_VST3.plist" --identifier "com.audiodamage.pkg.VST3" --version $version --install-location "/Library/Audio/Plug-Ins/VST3" "${name}_VST3.pkg"

pkgbuild --root "./au/" --component-plist "./${name}_AU.plist" --identifier "com.audiodamage.pkg.AU" --version $version --install-location "/Library/Audio/Plug-Ins/Components" "${name}_AU.pkg"

pkgbuild --root "./aax/" --component-plist "./${name}_AAX.plist" --identifier "com.audiodamage.pkg.AAX" --version $version --install-location "/Library/Application Support/Avid/Audio/Plug-Ins" "${name}_AAX.pkg"

productbuild --distribution "./Distribution.xml" --package-path "./" --resources "./Resources" --sign "Developer ID Installer: Audio Damage, Inc." "OSX_${name}_${version}.pkg"

rm "${name}_VST.plist"
rm "${name}_VST3.plist"
rm "${name}_AU.plist"
rm "${name}_AAX.plist"
rm "${name}_VST.pkg"
rm "${name}_VST3.pkg"
rm "${name}_AU.pkg"
rm "${name}_AAX.pkg"
rm -r "./aax"
rm -r "./vst"
rm -r "./vst3"
rm -r "./au"

Here’s what happens, in order:

  1. Make local folders for each plugin version.
  2. Copy plugins from /Library to local folders
  3. Perform AAX signing step.
  4. Create flat installers for each plugin.
  5. Package them together to a “thick” installer.
  6. Create final product from local assets.
  7. Remove all the stuff we created in steps 1 and 2 to tidy up.

I’m sure there’s a neater way to do this, with many clever Apple scripting tricks; I figured it out through trial and error. The XML distribution file for the above script looks like this (I obviously stole it straight from a Packages save, and am very much of the “if it ain’t broke” school of thought with regards to this sort of thing. Currently accepting submissions for a prettier version.)

<?xml version="1.0" encoding="UTF-8"?>
<installer-script authoringTool="Packages" authoringToolVersion="1.1.3" authoringToolBuild="2B112" minSpecVersion="1.0">
    <options/>
    <!--+==========================+
        |       Presentation       |
        +==========================+-->
    <title>DISTRIBUTION_TITLE</title>
    <background file="background" scaling="tofit" alignment="center"/>
    <welcome file="welcome.rtf"/>
    <license file="license.rtf"/>
    <!--+==========================+
        |         Installer        |
        +==========================+-->
    <choices-outline>
        <line choice="installer_choice_1"/>
        <line choice="installer_choice_2"/>
        <line choice="installer_choice_3"/>
        <line choice="installer_choice_4"/>
    </choices-outline>
    <choice id="installer_choice_1" title="Discord4 AAX" description="">
        <pkg-ref id="com.audiodamage.pkg.AAX"/>
    </choice>
    <choice id="installer_choice_2" title="Discord4 AU" description="">
        <pkg-ref id="com.audiodamage.pkg.AU"/>
    </choice>
    <choice id="installer_choice_3" title="Discord4 VST" description="">
        <pkg-ref id="com.audiodamage.pkg.VST"/>
    </choice>
    <choice id="installer_choice_4" title="Discord4 VST3" description="">
        <pkg-ref id="com.audiodamage.pkg.VST3"/>
    </choice>
    <!--+==========================+
        |    Package References    |
        +==========================+-->
    <pkg-ref id="com.audiodamage.pkg.VST3" version="4.0.1" auth="Root" installKBytes="9320">Discord4_VST3.pkg</pkg-ref>
	<pkg-ref id="com.audiodamage.pkg.AAX" version="4.0.1" auth="Root" installKBytes="9668">Discord4_AAX.pkg</pkg-ref>
	<pkg-ref id="com.audiodamage.pkg.AU" version="4.0.1" auth="Root" installKBytes="9295">Discord4_AU.pkg</pkg-ref>
    <pkg-ref id="com.audiodamage.pkg.VST" version="4.0.1" auth="Root" installKBytes="9059">Discord4_VST.pkg</pkg-ref>
    <!--+==========================+
        |    JavaScript Scripts    |
        +==========================+-->
</installer-script>

I really wish all this info was in one spot when I had to figure it out for myself during one of Package’s forced sabbaticals. So here’s to hoping it helps someone else.

(Side note: our products don’t have DRM, because stupid waste of time and resources. If you have an installer-based CP step, can’t help you.)

17 Likes