macadmins / SplashBuddy

Onboarding splash screen for MDM and Automated Device Enrollment.
Apache License 2.0
402 stars 71 forks source link

LaunchAgent issues with Monterey #136

Open wreck-gar opened 2 years ago

wreck-gar commented 2 years ago

Im not having any luck getting SplashBuddy to automatically launch after install as intended.

I've updated the postinstall and SplashBuddy.Launch.sh for python changes, but the bootstrap command in the postinstall script gives an input/out error. The SplashBuddy.Launch.sh script doesn't work either, I think it is related to the finderRunning function.

As a work around I have just made the postinstall script just open the app with -

/usr/bin/open -a "/Library/Application Support/SplashBuddy/SplashBuddy.app"

Not sure if this is a Monterey thing, or just a 'me' thing, anyone else having issues?

dkw7703 commented 2 years ago

We are experiencing the same issue, along with an additional one. Thanks to your script tweak, @wreck-gar, Splashbuddy will now launch. However, none of the items are updated as they are completed, nor does the Restart button become useable.

Bot-Igor commented 2 years ago

Hey there, For us it helped to remove the call of the finderRunning function and the function itself in the SplashBuddy.launch.sh file.

macgod73 commented 2 years ago

I noticed the issue with Monterey 12.3.1

I modified the postinstall script to

#!/bin/bash

loggedInUser=$( scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }' )
loggedInUID=`id -u ${loggedInUser}`

if [[ ${loggedInUID} -gt 500 ]]; then
    echo "Launching SplashBuddy for user ${loggedInUID}…"
    sudo -u \#${loggedInUID} launchctl enable gui/${loggedInUID}/io.fti.SplashBuddy.launch
    sudo -u \#${loggedInUID} launchctl bootstrap gui/${loggedInUID}/ /Library/LaunchAgents/io.fti.SplashBuddy.launch.plist
    sudo -u \#${loggedInUID} launchctl kickstart gui/${loggedInUID}/io.fti.SplashBuddy.launch
fi

Modified the SplashBuddy.launch.sh I changed the python portion to loggedInUser=$( scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }' )

Commented out the finderRunning function

# function finderRunning {
#    /usr/bin/pgrep Finder && return 0 || return 1
#}

Removed the function from the following

if appNotRunning \
    && appInstalled \
    && [ "$loggedInUser" != "_mbsetupuser" ] \
    && [ ! -f "${doneFile}" ]; then

    /usr/bin/open -a "$app"

fi

Removed the xattr attribute from the app (except I did this from composers build location). sudo xattr -r -d com.apple.quarantine /Library/Application Support/SplashBuddy/SplashBuddy.app

Repackaged all components in Composer and rebuilt the package.

Everything is working as expected in Monterey. I haven't backwards tested with Big Sur yet.