SwiftDialog not launching on login policy

L-plateAdmin
Contributor

Hi All, 

 

Im going to post this on the Slack as well for Dialog but wanted to see if anyone else has this issue.  i have a jamf policy that installs dialog (2.5.5-4802) and then pops open a window to display a local image).  idea is to provide a first login message to guide with first time setup.

 

so policy runs on login, installes the pkg and then runs a script with the dialog command in with a Nohup and & so the message can stay up whilst the rest of the polices run and get the macbook ready.

i can run the policy via recurring checkin, also by custom trigger, but when it runs on logon, the package installs but the window doesn't show.  I have checked the basic output from the policy log and they are identical with a 0 script exit.

 

this is the script, with some redactions:

#!/bin/bash

# History
# 

nohup /usr/local/bin/dialog --image "/Library/Application Support/My_Company/Images/JSM/firsttime.png" --title "Welcome - First Time Login" --moveable --hideicon --width 1371 --height 825 &

exit 0


i am confused to put it mildy.. and ideas why its not launching

 

5 REPLIES 5

sdagley
Esteemed Contributor III

@L-plateAdmin What happens if you have your script wait for the Finder process to be running (to wait for a user to be logged in) before calling dialog to display your image?

wakco
Contributor III

To run a dialog over the login window, both your script and the dialog must be executed within the Login Window context, without it, it just won't happen, this means running the script with outset, or properly setting up a LaunchAgent with LimitLoadToSessionType set to LoginWindow that can be started with:

 launchctl load -S LoginWindow /Library/LaunchAgents/yourScriptAgent.plist

 See: https://github.com/swiftDialog/swiftDialog/wiki/Login-Window

sdagley
Esteemed Contributor III

I think the question to @L-plateAdmin would be are they trying to display an image after the user has logged in, or do they want to display the image at the login window.

L-plateAdmin
Contributor

Yes ideally this is a note to guide the user in how to finish off their build by setting up device compliance and loading office, so yeah i will try and see if the finder process is a dependancy.  if it takes ages for finder/user login to then be able to display the image i'm close to setting this as the actual background at this point as it might be faster..  it will just take a full reboot to set it back to the normal background these days.

sdagley
Esteemed Contributor III

@L-plateAdmin If you want to display something at the login window you'll need to refer to the link @wakco provided describing how use swiftDialog at that point. For the case where you want the display to appear after the user logs in on modern Macs it usually only takes a few seconds for the Finder to load. IMO displaying something full screen in the foreground would grab more user attention than setting a background.