Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

Resolving the cocoaDialog Dependency

Matthew Warren edited this page Jan 27, 2017 · 2 revisions

cocoaDialog is used – and required – to present GUI elements on your users' Macs. That means cocoaDialog will need to be installed at known location on each of your endpoints.

Specifying the Location of the cocoaDialog Binary

By default, printer-installer.py looks for cocoaDialog at /Applications/cocoaDialog.app/Contents/MacOS/cocoaDialog

To specify your own location, edit source/printer-installer.source.py and update the CDPATH variable to reflect the correct path.

CDPATH = ("/Applications/cocoaDialog.app/Contents/MacOS/cocoaDialog")

If cocoaDialog is not found at the specified path, the script will attempt to install it by running a JAMF policy with a custom trigger. The name of this "remediation" trigger can be changed to fit your environment and is also found in source/printer-installer.source.py.

cocoaDialog_trigger = "InstallcocoaDialog"

This of course implies that this trigger actually calls a policy available on your JSS; see the "cocoaDialog Installation Policy" section below.

❗️Note: After modifying any configuration variables in source/printer-installer.source.py you need to re-run python generator.py

cocoaDialog Installation Policy

In order for the utility to automatically resolve the cocoaDialog dependency, you'll need to create a policy on your JSS to install cocoaDialog to a known location.

In summary, create a policy scoped to "All Computers" that installs your cocoaDialog package. Set a "Custom Trigger" that matches the cocoaDialog_trigger configuration variable specified in source/printer-installer.source.py

Installing cocoaDialog Temporarily, On-Demand

If you'd prefer not to leave cocoaDialog on your endpoints, you can create a cocoaDialog installer package that installs the app to /tmp as an action in your Self Service Policy.

Specifics on installing cocoaDialog to /tmp are (currently) outside the scope of this document. Briefly: Update your Self Service Policy to run the Printer Installer script "After" to ensure cocoaDialog is installed first. Update source/printer-installer.source.py to reflect the location of cocoaDialog within /tmp.