VBoxManage extpack install <tarball>
It seems like a Munki postinstall script as documented in the wiki
<http://code.google.com/p/munki/wiki/PreAndPostinstallScripts> is the
right way to do that. I can just put the extension pack on the server
and the Munki postinstall script would load it. The extension pack
needs to be the one for the current version of VirtualBox, so is there
anyway for my postinstall script to use get the VirtualBox version
from the Munki pkgsinfo plist?
<key>name</key>
<string>VirtualBox</string>
<key>version</key>
<string>4.1.2</string>
So my postinstall script would be
#!/bin/sh
VBoxManage=/Applications/VirtualBox.app/Contents/MacOS/VBoxManage
# Get version from Munki pkgsinfo plist
ExtensionPack=/nfs/Installers/Apps/Oracle/Oracle_VM_VirtualBox_Extension_Pack-${version}.vbox-extpack
${VBoxManage} extpack install ${ExtensionPack}
I guess I can get the info from the install VirtualBox using `pkgutil`.
% pkgutil --pkg-info org.virtualbox.pkg.virtualbox | awk '/version/{print $2}'
4.1.2
Paul
# defaults read /Applications/VirtualBox.app/Contents/Info CFBundleShortVersionString
4.1.2
Of course, since the postinstall script is _in_ the pkginfo, you already know the version...
-Greg
Using `defaults read` is probably faster than using `pkgutil` and
`awk`. So I'll probably go that way.
I'm a new Munki user and haven't quite gotten all the ins and outs sorted yet.
Paul
My recommended approach would be to create one or more "payload-free" packages that used a postflight script to install the extensions. The extension(s) would be included in the package contents, so they'd be sure to be available on the machine at time to install.
But creating "payload-free" packages is a skill of its own.
-Greg
So besides those versions, you'll also have to manually increment whatever it is you'll end up using as a proper installs key for the extension pack, e.g.:
md5 -q /Applications/VirtualBox.app/Contents/MacOS/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/ExtPack.xml
<key>installs</key>
<array>
<dict>
<key>md5checksum</key>
<string>cd5b3d5070e2ec4c885f85cd517b6569</string>
<key>path</key>
<string>/Applications/VirtualBox.app/Contents/MacOS/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/ExtPack.xml</string>
<key>type</key>
<string>file</string>
</dict>
</array>
In the end there was so much fiddling associated with maintaining the Vbox/extpack pkginfo in general, that I ended up using a separate shell script dedicated just to handle its particular pkginfo creation, incrementing version numbers, md5, etc. It's not the only package I ended up doing that for, and it's not always pretty, but for these odd duck cases it's been my strategy so far.
- Jason