Deploying Photo Mechanic with Munki

Earlier this year Camera Bits consolidated the different Photo Mechanic (PM) versions into a single “All-in-One” download.

The cataloging feature of Photo Mechanic Plus is now simply activated (or not) by the license used to activate the application. (This is exactly how Microsoft handles Office for Mac.)

There are now subscriptions as well as perpetual licenses available which all use the same download.

Thankfully the ability to programmatically activate and deactivate is still there so only a few changes are needed in our Munki scripts.

Read on for the required changes…


What follows is an update to my previous posts without all the background details:


To automate the activation and deactivation we use a postinstall_script and a preuninstall_script in the Munki PkgInfo file for Photo Mechanic.

Activation

The postinstall_script will get executed after PM is installed by Munki. This script queries the activation status and then applies the registration if needed. Edit the script to substitute your company’s registration information.

#!/bin/bash
if "/Applications/Photo Mechanic.app/Contents/MacOS/PMLicenseSpringHelper" checkLocalActivationValid PM; then
	echo "Photo Mechanic is already activated, no action needed."
else
	echo "Photo Mechanic is not activated, activating online."
	"/Applications/Photo Mechanic.app/Contents/MacOS/PMLicenseSpringHelper" activateOnline PM XXXXXXXXXXXXXXXX
fi

Deactivation

The preuninstall_script will get executed by Munki before PM is uninstalled. This script deactivates the computer before the application is removed from disk and can be used as-is.

#!/bin/bash
if "/Applications/Photo Mechanic.app/Contents/MacOS/PMLicenseSpringHelper" deactivateOnline PM; then
	echo "Photo Mechanic has been deactivated."
else
	echo "There was a problem deactivating Photo Mechanic."
fi

AutoPkg

I have updated my AutoPkg recipes for the new release of Photo Mechanic and the changed scripts: https://github.com/autopkg/kevinmcox-recipes/tree/master/Camera%20Bits%2C%20Inc.

Leave a Reply

Your email address will not be published. Required fields are marked *