mirror of
https://github.com/kyleneideck/BackgroundMusic
synced 2025-02-16 20:28:26 +00:00
Make sure the installer launches BGMApp as the logged-in user.
This commit is contained in:
parent
e6e784b013
commit
4c7eba30af
1 changed files with 7 additions and 1 deletions
|
@ -55,9 +55,15 @@ bash "post_install.sh" "$xpc_helper_path" "BGMXPCHelper.xpc/Contents/MacOS/BGMXP
|
|||
# That way, if the user moves BGMApp and then installs a newer version of Background Music, the
|
||||
# installer will try to find the old version of BGMApp and put the new one in the same place.
|
||||
#
|
||||
# Use launchctl to make sure we don't run BGMApp as the installer user.
|
||||
#
|
||||
# If we can't open BGMApp, it very likely didn't install properly, so we fail the install.
|
||||
open -b com.bearisdriving.BGM.App || \
|
||||
logged_in_user_id="$(id -u "${USER}")"
|
||||
launchctl asuser "${logged_in_user_id}" \
|
||||
open -b com.bearisdriving.BGM.App || \
|
||||
launchctl asuser "${logged_in_user_id}" \
|
||||
open "${dest_volume}/Applications/Background Music.app" || \
|
||||
osascript -e 'tell application "Background Music" to activate' || \
|
||||
exit 1
|
||||
|
||||
# The installer plays a sound when it finishes, so give BGMApp a second to launch.
|
||||
|
|
Loading…
Add table
Reference in a new issue