Skip to content

Commit 5e2a549

Browse files
committed
fix: always run postinstall app open as logged-in user
1 parent f3468db commit 5e2a549

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkgbuild/scripts/postinstall

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ spctl -avvv "/Applications/Coder Desktop.app/Contents/Library/SystemExtensions/c
3232
# Restart Coder Desktop if it was running before
3333
if [ -f "$RUNNING_MARKER_FILE" ]; then
3434
echo "Starting Coder Desktop..."
35-
open -a "Coder Desktop"
35+
# When deploying the app via MDM, this script runs as root. The app cannot
36+
# function properly when launched as root.
37+
currentUser=$(/usr/bin/stat -f "%Su" /dev/console);
38+
/bin/launchctl asuser $(/usr/bin/id -u "$currentUser") /usr/bin/open "/Applications/Coder Desktop.app"
3639
rm "$RUNNING_MARKER_FILE"
3740
echo "Coder Desktop started."
3841
fi

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy