May 2015

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.


Download


cocoaDialog_3.0.999.zip


For the unbelievererers here's proof on a 10.10.3 client


#!/bin/bash
/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..."
exit


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


alllright

Comments

Where have I been?

It's been a long time between posts. I've changed jobs and have been swamped trying to bring singlehandedly some order a completely unmanaged OSX and iOS fleet into order across 18 sites and entire country. It's also a complete change as I am now in edu. Apologies for lack of work on Patchoo!, but I hope to have some more time to work on v2 soon!

I am planning on writing up my battles with VPP / DEP / GroundControl / Casper and iOS shared carts soon as most information out there is not current, and I've built a pretty good workflow within the constraints of the MDM frameworks.

More to follow!

Comments