Instead of the displayMessage switch to the JAMF binary, use the jamfHelper app instead. You can invoke this command in the following way to lock the screen:
/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -windowType fs -description "Installing Apple Software Updates. Your machine will restart when completed." &
You can get more information on how to use the switches if you open the terminal and issue:
sudo /Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -help
I typically use this in a "before" script to lock the screen and then do my installs at logout. Just make sure if you use it that you issue a "killall jamfHelper" in the "Run command" dialog box of the Advanced tab in a policy.
Do a search of the JAMFNation site for more discussions on jamfHelper. We've had plenty over the last few years.
Steve
Use the jamfHelper instead to display your message. If you don't explicitly specify a button, none will be shown. Something like this:
#!/bin/sh
/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -windowType utility -description "Installing software, please wait..."
Note that jamfHelper must also be run as root, so as long as your script is running from within Casper it should work fine.
Also, I'm not 100% sure, but I think when run this way, you'll need to kill the jamfHelper process to make the message go away. I think there's a flag for that in the help-
sudo /Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -help
Edit: Heh, funny. Nearly similar posts from Steve and I
You get the picture though!