Posted on 01-13-2014 07:47 AM
Our organization has been using CocoaDialog progress bars at logout to display the installation progress of non-Apple and Apple software updates. Recently I've been working on our Mavericks image (which has been quite a pain, to say the least) and we have noticed that CocoaDialog progress bars aren't being displayed during logout. I am positive that the policy scope is correct and that the update actions are running, but the dialogs are just not being displayed. In addition, I have verified that the progress bar windows are being displayed correctly when executed while I am logged in. Has anyone seen this problem and found a solution, or is there any other application we could use to accomplish this task on 10.9? Please let me know.
Thank you,
Dakota Wandro
Imaging Specialist
Posted on 05-19-2015 06:53 PM
Doesn't work on a logout hook though. Not sure what jamfHelper is doing there.
Posted on 05-19-2015 07:55 PM
@loceee This works using a LaunchDaemon with the regular v3.0b of cocoadialog.
Posted on 05-19-2015 08:11 PM
Ahaha. I was actually about to test the original release now. What a numpty. Move along, nothing to see here.
Posted on 05-20-2015 01:26 AM
@nigelg Imm not sure if the JAMFHelper is a signed app.. That might help.
Also it maybe the method used to call JAMFHelper.
@jesseshipley works at logout via a launchdaemon?
Posted on 05-20-2015 09:25 PM
Try that binary again... looks like I might have cracked it... cocoaDialog.zip
sudo defaults read com.apple.loginwindow LogoutHook
{
LogoutHook = "/Library/Scripts/logouthook.sh";
}
/Library/Scripts/logouthook.sh
#!/bin/bash
/Applications/cocoaDialog.app/Contents/MacOS/cocoaDialog ok-msgbox --text "I am displaying on a logout hook"
sleep 1
exit
Ya'll owe me a beer at JNUC if I fixed it.
Posted on 05-21-2015 01:48 PM
I tested @loceee build of CocoaDialog with @dwandro92 script with a JSS logout trigger and it worked! Well done! Did you have to just remove the legacy code from CocoaDialog? Any other tweaks?
Posted on 05-21-2015 02:03 PM
Ya'll owe me a beer at JNUC if I fixed it.
Indeed! Will you actually be making it out there this year?
Posted on 05-21-2015 02:21 PM
@loceee thank you for fixing this. Will you be pushing your changes to your fork of CocoaDialog on your GitHub repo?
Posted on 05-21-2015 05:48 PM
@mm2270 actually pretty unlikely. 2 kids in childcare and a mortgage... and I kinda doubt I can get $ out of work to ship me over. Pour one out for me though.
@ssrussell other tweaks I found in similar projects - all in github fork now.
@jhbush1973 done. https://github.com/loceee/cocoadialog
INSERT shameless plug - all details on my blog - http://www.rehrehreh.com
Posted on 05-21-2015 07:55 PM
Very cool, @loceee. Thanks for your effort on this. You should try to do a PR back to the main repo too.
Posted on 05-21-2015 08:09 PM
@mscottblake is anyone even maintaining the repo anymore?
Posted on 05-21-2015 08:11 PM
@loceee I know he pays attention, and he might bring in the changes since he doesn't have to do the work. Otherwise, no.
Posted on 05-21-2015 08:13 PM
Posted on 05-22-2015 11:34 AM
well @jesseshipley if you are taking requests, the bubble notifications should turn into notification center items. Although I still think that is the worst new feature they have provided, a notice pops up and disappears somewhere I never remember to look for notices, much like JAMF notices winding up there. But maybe some people actually use that thing regularly and it would be handy for those notices to go there.
Posted on 05-22-2015 11:44 AM
Depending on how it goes @nessts that could be a part of it. Currently Yo does that very well and they are persistent alerts not just banners. Check it out here https://github.com/sheagcraig/yo.
Posted on 05-22-2015 11:48 AM
@jesseshipley Kind of psyched to hear that you'll actually be looking to keep cocoaDialog alive! As you can imagine and see by the myriad threads here, its one of those tools that, should it just stop working one day, there will be many sad Mac admins out there. :'-( We'd all survive of course, but our world will be a little duller and more "cookie cutter" like if you ask me. So any effort you put into this will be much appreciated!
I'm looking forward to see what you can do. Just fixing a few of the current bugs would be a major thing by itself. For example, I had to stop using the dropdown window style a few OS versions back as the window size doesn't respect the amount of text you add to the dialog, meaning the drop down menus get smooshed up against the text, looking rather ugly. No amount of fiddling has been able to work around the issue in all my testing.
FWIW, I kind of stopped using the bubble or notify window a while ago. Although I generally would agree with @nessts on what he's stating, at least NC messages get logged into the full Notification Center view, and the user can see them later if they happened to miss them. The bubble/notify style in CD just disappears after the time out and does not log anything anywhere, so they can be completely missed. I don't see much point in using them anymore, and the original developer was thinking the same thing before he dropped any development on it.
Posted on 05-22-2015 11:53 AM
Haha. Go @jesseshipley! go!
Posted on 05-22-2015 11:54 AM
@bentoms only way I'll make it happen is by making myself fully accountable for it. Now everyone in the IRC, here, and my boss expects it to happen. Completely painted into a corner now haha.
Posted on 05-22-2015 12:55 PM
@jesseshipley let us know if we need to send you some caffeine at any point. :)
Posted on 05-22-2015 01:47 PM
I'd just like to point out I still use the CocoaDialog progress dialog to output rsync progress at login hook, as that is what I use for roaming mobile profiles (flawlessly). Logout is just a black screen. I've not been able to get anything on top of that hook's screen since 10.8 I don't think.
One has to wonder if swift has any value here.
Posted on 05-22-2015 03:00 PM
@chris.hotte a number of the functions within CocoaDialog have been deprecated now & so large parts need to be re-written/replaced.
So my idea was to attack it in Swift as then they would be current functions & it would have been a cool swift project.
But as @jesseshipley has more swift knowledge & seemingly more drive.. I just talked them into it.
Meanwhile, I can bugger about with $other_projects
Posted on 05-22-2015 03:05 PM
@bentoms More wife knowledge? How can I get some of that please? I never quite seem to have enough of that... and some days it gets me into trouble.
Posted on 05-22-2015 03:14 PM
Posted on 05-22-2015 03:46 PM
My wife knowledge is greatly exaggerated seeing as I'm without one.
Posted on 05-22-2015 11:30 PM
Haha. Gotta love a typo.
Posted on 05-25-2015 05:38 AM
if you want a sandwhich its more like
#!/bin/sh
nice -10 make_me_a_sandwhich
if [ -e /tmp/hell_no ]; then
sudo please
fi
Posted on 05-26-2015 02:31 PM
@nessts haha good point, please goes a long way. I never used the nice
binary before, very interesting.
Posted on 05-27-2015 02:03 AM
@loceee Awesome, I will be giving that a try! Could maybe use it instead of messing around in Cocoa anyway - I used my own progress bars in 10.8 but couldn't in 10.9. Also can't wait to see the new swift version @jesseshipley
Posted on 04-14-2016 11:45 AM
@jesseshipley - Were you able to make any progress on updating CocoaDialog over the last year?
Posted on 04-14-2016 11:47 AM
@jreitzersmith I postponed it to this year waiting en El Cap and some other stuff. I have a couple of tools I'm hoping to build for the community and will post them once I have more info to share.
Posted on 05-25-2016 12:15 PM
Redacted.
Posted on 08-10-2016 06:47 AM
So I got a cocoa app written in swift to appear at logout. Its just a very basic app that opens a window for now - just a test case but happy I got it working. The code I need to add was a single line.
self.window.level=2147483631
Heres is my appdelegate code. It makes a window appear then it pauses for 10 seconds before it terminates the application.
I used 2 sources - the new version of Cocoa Dialog that @loceee made and the FileVault code from here that he referenced on his github. Initially I had a lot of extra lines in there but turns out that all I needed was to set the window level to be higher than the fullscreen window at logout. So simple now I've got it working.
import Cocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
@IBOutlet weak var window: NSWindow!
func applicationWillFinishLaunching(notification: NSNotification) {
}
func applicationDidFinishLaunching(aNotification: NSNotification) {
// Insert code here to initialize your application
self.window.level=2147483631
let time = dispatch_time(dispatch_time_t(DISPATCH_TIME_NOW), 10 * Int64(NSEC_PER_SEC))
dispatch_after(time, dispatch_get_main_queue()) {
//put your code which should be executed with a delay here
NSApplication.sharedApplication().terminate(self)
}
}
func applicationWillTerminate(aNotification: NSNotification) {
// Insert code here to tear down your application
}
}