cocoaDialog fix for 10.9, 10.10

This has been a problem for a looooong time. As of 10.9, Apple made changes to how applications are allowed to present UI outside of a logged in session.

Due to this change a stalwart of the MacAdmin tool belt, cocoaDialog (which has be unfortunately stagnant for some time), found itself unable to display a dialog during a logout. This affected a fair few people, myself included.

Today I have some good news. I somehow have managed via excessive Googling, kludging and fumbling my way around a bunch of obj-C I really didn't understand, seem to have managed to chop in some changes that allows it to work on the logout hook.

There is a discussion on jamfnation.

And my fork is here with a binary you can download. USE AT YOUR OWN RISK and feel free to fix whatever mistakes I've made.

I am not going to actively undo some of the ridiculous workarounds in Patchoo as I have some pretty massive code and workflow changes slated for Patchoo2.



For the unbelievererers here's proof on a 10.10.3 client

/Applications/cocoaDialog.app/Contents/MacOS/cocoaDialog msgbox \
--text "I am displaying on a logout hook on $(sw_vers | grep ProductVersion | awk '{ print $2 }')" \
--button1 "Alright, alright, all right..."

Nothing up my sleeve

sudo defaults read com.apple.loginwindow LogoutHook
LogoutHook = "/Library/Scripts/logouthook.sh";

Screen Shot 2015-05-22 at 10.13.16 am



0.994 - fixes & major OSX Upgrades

Patchoo 0.944 has been pushed and fixes handling of zipped pkg bundles on Casper 9. I've only recently migrated to the new 9 format (don't ask) and there was a bug when looking up zipped pkg friendly names in the JSS.

Changes in this release:

  • correctly handle and lookup zipped pkg bundle info from the JSS.
  • improvements in OSX upgrades using createOSXInstallPKG
  • fixed a small UI discrepancy in the OSX upgrade prompts
  • quoted api credentials handle special chars in passwords.

Did you know you can perform major OSX upgrades via Patchoo? By using createOSXInstallPKG and patchoo you can provide as convenient admin hands-off major OSX upgrade deployment to 10.9 (or 10.10) via Casper.

Screen Shot 2014-07-07 at 11.35.44 am

Here's a great tip!

Use a smart group to scope your deployment, and utilise nested groups to release it to clients as you require. Some organisations may have legacy enterprise software which may not be supported by the latest release of OSX. Instead of doing a blanket upgrade to all clients you can do the following:

Scope the patchoo requirements like so:

Cached Pkg does not have: OSXInstall10.9.3.pkg.zip
OS is not like, 10.6,10.9, 10.10

And then you can setup a static computer group (update10.9-manual) to add Macs you wish to upgrade to.

Group them in ( ) with OR, and you can add an entire department or office smart group to deploy Mavericks (or Yosemite) to a all computers without further admin interaction.

Once they are scoped correctly (make sure you check!), you might like to send an email direct from the JSS advising users of the impending upgrade and what to expect. Don't have your JSS populated with your user's directory information and email addresses? Don't worry, I can help there too.

Screen Shot 2014-07-08 at 10.19.15 am

Users receive updates in the same way they usually do, but are prompted additionally that the update requires AC power and will take up to 90 minutes.


For more information please read the documentation here. Deploying Major OSX Upgrades

Mavericks & Yosemite Yup!


I love cocoaDialog, but it seems that Mavericks and Yosemite don't as much. It was always going to be a risk, relying on software that's been stagnating for 2 years without an update... if I had the smarts I'd pick it up, but I don't.

Until someone can take cocoaDialog and update it for Mavericks new security features... (as stated by Greg Neagle - apps need to do very specific things to be allowed to play outside of a logged in user session in 10.9+) ... I've shoehorned a workaround, which whilst not terribly elegant, it does the job.

Patchoo 0.9931 - https://github.com/patchoo/patchoo

It performs a fauxLogout by quitting all apps (this will break [x] Reopen on Login), then uses the ARD framework's LockScreen to prevent user interaction. It also tweaks cocoaDialog LSUIEelement and LSUIPresentation mode for the install run. This hides the Dock and Menu bar. Taddaa!

A kludgey pretty awful, but functional way to lock down whilst we perform software installations.

Grab the latest code and let me know how you go!