We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0dc424c commit 0d77ec3Copy full SHA for 0d77ec3
pkgbuild/scripts/postinstall
@@ -32,7 +32,10 @@ spctl -avvv "/Applications/Coder Desktop.app/Contents/Library/SystemExtensions/c
32
# Restart Coder Desktop if it was running before
33
if [ -f "$RUNNING_MARKER_FILE" ]; then
34
echo "Starting Coder Desktop..."
35
- open -a "Coder Desktop"
+ # 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"
39
rm "$RUNNING_MARKER_FILE"
40
echo "Coder Desktop started."
41
fi
0 commit comments