Skip to content

fix: always open app as logged-in user in postinstall script #216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: ethan/progress-auto-start
Choose a base branch
from

Conversation

ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Aug 5, 2025

This PR prevents issues like:

Screenshot 2025-07-30 at 3 57 07 pm

which occur when the app is launched as root. This can happen when the installer scripts are run as root, which is the case when deploying Coder Desktop over MDM. (As a convenience, we re-open the app if it was open before the installer was ran.)

Of note is that on macOS, it is not sufficient to just run open with sudo -u, as that does not use the execution context of the user. See https://developer.apple.com/forums/thread/78332

Reports of the bug in other programs:
(with an incorrect solution) https://community.zoom.com/t5/Zoom-Meetings/A-keychain-cannot-be-found-to-stoer-quot-Zoom-quot/m-p/51059
https://displaylink.org/forum/showthread.php?p=97176

Copy link
Member Author

ethanndickson commented Aug 5, 2025

@ethanndickson ethanndickson force-pushed the ethan/run-reopened-gui-app-as-user branch 2 times, most recently from 5e2a549 to 2794fe6 Compare August 5, 2025 06:52
@ethanndickson ethanndickson self-assigned this Aug 5, 2025
@ethanndickson ethanndickson marked this pull request as ready for review August 5, 2025 07:28
@ethanndickson ethanndickson changed the title fix: always run postinstall app open as logged-in user fix: always open app as logged-in user in postinstall script Aug 5, 2025
@ethanndickson ethanndickson force-pushed the ethan/progress-auto-start branch from f3468db to d04e73f Compare August 6, 2025 02:24
@ethanndickson ethanndickson force-pushed the ethan/run-reopened-gui-app-as-user branch from 2794fe6 to f404c56 Compare August 6, 2025 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants