Deploying Photo Mechanic 6 with Munki

Photo Mechanic 6 (PM), released last year, is a major overall to the venerable software used by photojournalists worldwide. It is now 64-bit for compatibility with macOS Catalina and includes a number of other changes from PM5.

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

What follows is basically the same as my post from last year, Deploying Photo Mechanic 5 with Munki, without all the background details, so read on if you want to see the changes needed to the scripts.

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

First 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 parameters to substitute your company’s registration information, making sure to escape spaces.

#!/bin/bash

if "/Applications/Photo Mechanic 6.app/Contents/MacOS/Photo Mechanic 6" --activated
	then
		/bin/echo "Photo Mechanic 6 is already activated, no action needed."
	else
		/bin/echo "Photo Mechanic 6 is not activated, applying registration."
		"/Applications/Photo Mechanic 6.app/Contents/MacOS/Photo Mechanic 6" --activate --name=Galveston\ Newspapers,\ Inc. --department=Photography --license=XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
fi

Alternatively you can just run the one-line activation command on every installation/upgrade without the logic. Senior Software Engineer Kirk Baker confirmed to me that, “Activating a system that has already been activated does not increase the activation count.”

There is also an undocumented optional parameter which can be used in the activation:

--description="Description of computer"

When this parameter isn’t specified it will be automatically generated and defaults to, “Computer Name – Model – Serial Number.” This description information will be used by Camera Bits support when working with users to find older activations that can be removed from the system.

Last is the preuninstall_script which 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 6.app/Contents/MacOS/Photo Mechanic 6" --deactivate
	then
		/bin/echo "Photo Mechanic 6 has been deactivated."
	else
		/bin/echo "There was a problem deactivating Photo Mechanic 6."
fi

Let me know if you have any questions and I’ll be happy to help.

Leave a Reply

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