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.9941 - Autopkg + JSS + Patchoo! & No more Mr. Nice Admin

AutoPKG + JSS-autopkg-addon + Patchoo

The holy grail of Casper software deployment?

If you don't know how cool AutoPKG is, you best get acquainted. In a nutshell, it will follow a recipe - check, download and repackage software for you, and with the very recent addition of a GUI it will do it at the touch of a button!

I am yet to get my hands dirty with the way it all works myself, but Allister Banks has built a processor for AutoPKG that every JAMF admin should be very excited about.

JSS-autopkg-addon effectively takes freshly built pkgs from autopkg, loads them onto your CDP and then creates the necessary smart groups and policies required for distribution. Cool beans! There has been a bit of talk on JAMF Nation and various channels about some of the shortcomings of Casper software deployment, that it's far too admin heavy. Automating a lot of the tedium around policy and smart group creation will go along way to solving this until JAMF revamps it's software deployment tools.

Calum Hunter has modified the policy and smart group template that JSS-autopkg-addon uses, and it can now dump these freshly created flat pkgs into your patchoo-dev track 100% ready for testing and deployment!

  1. AutoPKG recipe runs.
  2. Go to your dev/testing Mac client and start a Patchoo run click "Check for Updates" in Self Service.
  3. Test deployment and app function.
  4. Move update to beta.
  5. Move update to production.

A huge thanks to all the AutoPKG gang, all the Patchoo users and the entire Mac Admin community. We are all doing and ever more importantly, sharing some awesome work! We are the pirates taking over enterprise IT!

Nasty Mode

No more Mr. Nice Admin!

Until now, Patchoo has pseudo forced installations once the defer counter expired. There was only one button, but by design I didn't want a timeout to logout and install if a Mac was unattended.

Unfortunately, in this day and age of modern client management, those tricky users will find a loophole and do their darndest to not install software patches. We have a few users that are deliberately ignoring the all installations prompts. Catching them in the PatchooDeferCount10+ group and sending reminder emails from the JSS worked, sometimes, but at some sites I had to engage support technicians to physically walk to desks and talk with users. That's not a great use of anyone's time.

But in the end, it's too much admin work and there will always be people that don't have the 5 minutes a month it takes to patch their systems. Well, no more....


When enabled (default), if the final forced update prompt is ignored, users are forcibly logged out and patches are installed. Users ARE allowed to save work and will be prompted. Stuck apps will pause the logout process, but it's persistent and will keep quitting apps until users are logged out.

If you are in the same situation, addressing the issue as a security and compliance matter is the best way to allay complaints. We are a public US company and must comply with SOX, even if it sometimes can be slightly inconvenient for our staff.

Get the latest commit


You'll also notice a long overdue license file in the repo as well. Patchoo is released under Apache 2.0.

I'm no fancy big city lawyer, but this pretty much means you can use it how you want. I've had some great interest and been surprised at some of the really cool companies that are using it (most I can't mention unfortunately). Hopefully this means a few more with more stringent legal requirements can use it too!


If you'd like to contribute please feel free to reach out, or get on Github and submit pull requests!


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!


Patchoo v0.99

It's here and features some great enhancements.

  • changed name of PreUpdate to patchooStart
  • new super progress bar for jamf installs!
  • new --cache mode minimises admin workload, no more passing metadata direct to the script!
  • changes to parameters and order on patchoo.sh.
  • some updated docs and screengrabs. Included the Self Service policies…
  • packaged triggers as promised.

Make sure if you were using 0.98 read the docs! The parameter order and --cache mode has changed!

Now it's as simple as uploading your package, adding a nice name in the info field, create your smart group, create your policy to cache the pkg, then just add patchoo.sh --cache to run AFTER.


Patchoo figures out what's been added to the JAMF/Waiting Room and pulls the pkg metadata direct from the JSS api!


Now imagine if some robots could make your packages for you, then import them into the JSS and create your smart group for you.

What a world we live in!