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.
UPDATE 1/18/20: I have published my AutoPkg recipes that allow the above scripts to be automatically configured whenever a new version of Photo Mechanic 6 is added to Munki. View them here: https://github.com/autopkg/kevinmcox-recipes
Pingback: Weekly News Summary for Admins — 2020-02-14 – Scripting OS X
this is nice How-To. Thanks.
Do you have a solution íf the systems are in the network of the company with a proxy?
In Munki report I can see:
Running postinstall_script for Photo Mechanic 6 failed.
Photo Mechanic 6 is not activated, applying registration.
Result was: “The Authentication Server was unable to be contacted.
Please make sure you have an active internet connection
and try again. If this problem persists, please contact
Camera Bits for assistance: +1 503 547-2800
There is an offline registration method, but I don’t think you’ll be able to automate it.
Best bet is probably to contact Camera Bits and find out the details on their activation server so you can make sure computers can communicate with it freely.