This post will describe how to deploy and license ChemDraw Pro 15 via Munki. As with my previous post on Mathematica, an easily modifiable script for building a license pkg can be found on my Github.

Prerequisites:
  • ChemDraw Pro .dmg. At the time of writing, the current disk image has the default name of cdpf151.dmg.
  • The license info for your organisations ChemDraw Pro setup.
Importing ChemDraw Pro:
  • Import the disk image:
munkiimport /path/to/ChemDrawPro.dmg
  • Configure the pkginfo metadata to your requirements. In this case, we are using ChemDrawPro15 for the name key.
  • Configure the installs and items_to_copy arrays to respect the contents of the disk image. In the case of ChemDraw Pro 15, there are 2 plugins at the root of the .dmg, alongside the main .app bundle, that we want our Munki package to install.
  • Your items_to_copy array should look like this:
<key>items_to_copy</key>
	<array>
		<dict>
			<key>destination_path</key>
			<string>/Applications</string>
			<key>source_item</key>
			<string>ChemDraw Professional 15.1.app</string>
		</dict>
		<dict>
			<key>destination_path</key>
			<string>/Library/Internet Plug-Ins</string>
			<key>source_item</key>
			<string>ChemDraw Plugin Professional.plugin</string>
		</dict>
		<dict>
			<key>destination_path</key>
			<string>/Library/QuickLook</string>
			<key>source_item</key>
			<string>CDQuickLook.qlgenerator</string>
		</dict>
	</array>
  • And your installs array should look like this:
<key>installer_type</key>
	<string>copy_from_dmg</string>
	<key>installs</key>
	<array>
		<dict>
			<key>CFBundleIdentifier</key>
			<string>com.perkinelmer.CDQuickLook</string>
			<key>CFBundleName</key>
			<string>CDQuickLook</string>
			<key>CFBundleShortVersionString</key>
			<string>1.0</string>
			<key>CFBundleVersion</key>
			<string>1</string>
			<key>path</key>
			<string>/Library/QuickLook/CDQuickLook.qlgenerator</string>
			<key>type</key>
			<string>file</string>
			<key>version_comparison_key</key>
			<string>CFBundleShortVersionString</string>
		</dict>
		<dict>
			<key>CFBundleIdentifier</key>
			<string>com.cambridgesoft.chemdrawplugin</string>
			<key>CFBundleShortVersionString</key>
			<string>15 . 1 . 0</string>
			<key>CFBundleVersion</key>
			<string>15 . 1 . 0</string>
			<key>path</key>
			<string>/Library/Internet Plug-Ins/ChemDraw Plugin Professional.plugin</string>
			<key>type</key>
			<string>file</string>
			<key>version_comparison_key</key>
			<string>CFBundleShortVersionString</string>
		</dict>
		<dict>
			<key>CFBundleIdentifier</key>
			<string>com.cambridgesoft.ChemDraw.15</string>
			<key>CFBundleName</key>
			<string>ChemDraw</string>
			<key>CFBundleShortVersionString</key>
			<string>15 . 1 . 0</string>
			<key>CFBundleVersion</key>
			<string>15 . 1 . 0</string>
			<key>minosversion</key>
			<string>10.10</string>
			<key>path</key>
			<string>/Applications/ChemDraw Professional 15.1.app</string>
			<key>type</key>
			<string>application</string>
			<key>version_comparison_key</key>
			<string>CFBundleShortVersionString</string>
		</dict>
	</array>
  • NOTE: The odd spacing of the values for the CFBundleVersion and CFBundleShortVersionString keys is an ongoing issue with CambridgeSoft .dmgs. I don't recommend sanitising them.
  • When you're happy with the pkginfo file, save and quit.
Package the license:
  • ChemDraw Pro uses an XML .plist for it's license. In order to generate a properly formatted, working file, I first installed the software on a test machine, and manually entered the license details when required. This generates a license file at the following location:
/Users/Shared/Library/Preferences/com.cambridgesoft.plist
  • After some testing, I found that placing the file in /Users/Shared is not necessary. ChemDraw Pro respects the system /Library/Preferences directory. As this location is less readily accessible to a regular user, I built the license package to install the file to that location. To build the package:
  • Make a working directory:
mkdir -p chemdrawpro15-license-pkg/Payload
cd chemdrawpro15-license-pkg
  • Copy the license file to the Payload directory:
cp /Users/Shared/Library/Preferences/com.cambridgesoft.plist Payload/
  • Build the package, choosing a version appropriate to your organisation/deployment:
pkgbuild --root Payload --install-location /Library/Preferences --version 15.0 --ownership preserve --identifier your.org.chemdrawpro15-license Your-Org-ChemDrawPro15-license.pkg
  • Import the package:
munkiimport Your-Org-ChemDrawPro15-license.pkg
  • Configure the pkginfo as follows:
<key>update_for</key>
   <array>
        <string>ChemDrawPro15</string>
   </array>
  • Run makecatalogs
makecatalogs
  • Create a software manifest for ChemDrawPro15, in order that access to the application can be scoped to appropriate machines:
manifestutil
> new-manifest $YOUR_CHEMDRAWPRO15_MANIFEST
> add-pkg ChemDrawPro15 --manifest $YOUR_CHEMDRAWPRO15_MANIFEST --section optional_installs
> exit
  • And that's a wrap.