Skip to content
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

System Settings breaks in macOS Sonoma #17

Open
popaprozac opened this issue Oct 19, 2023 · 7 comments
Open

System Settings breaks in macOS Sonoma #17

popaprozac opened this issue Oct 19, 2023 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@popaprozac
Copy link

popaprozac commented Oct 19, 2023

Issue
System Settings fails to open after setting a default app

Steps to reproduce

  • msda set com.google.chrome -p http -p https -u public.url all -u public.html viewer -u public.xhtml all -fut or any set command.
  • Attempt to open System Settings.

Symptoms
After setting any app as a default app, System Settings fails to load properly. The app launches but does not display any windows and this is the View menu:
Screenshot 2023-10-19 at 2 45 15 PM

Workaround
I have been able to reset the LaunchServices and open System Settings by running the following:

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -all local,system,user

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -seed

The good news is the change is applied successfully so after resetting all LaunchServices System Settings open and the default app is set correctly.

@popaprozac
Copy link
Author

Looks like removing the sudo command from the rebuild fixes the issue.
Will submit a PR asap.

@targendaz2 targendaz2 added the bug Something isn't working label Oct 20, 2023
@targendaz2 targendaz2 self-assigned this Oct 21, 2023
@targendaz2
Copy link
Owner

@popaprozac 2 questions:

  • Are you running the command from your OP as root?
  • Is there a logged in user when you run that command?
  • How are you running this command? (e.g. via MDM, manually, etc.)

The script tries to reset the LS database as the currently signed in user or root, depending on the context. My concern is that removing sudo altogether could cause issues in certain contexts (e.g. Setup Assistant).

@popaprozac
Copy link
Author

Thanks for the follow up!
The package is deployed via MDM but the script is run separately via a policy. I found that removing sudo from msda when running the policy via MDM or locally (both situations with a logged in user) it runs as expected. When running locally I use sudo msda but the script run via policy omits the sudo.

@mmtechconsulting
Copy link

mmtechconsulting commented Apr 21, 2024

Same issue here - any ideas how to fix it? - Running the script through JAMF

@alexanderharm
Copy link

alexanderharm commented May 24, 2024

I suffer from the same issue.

  • command is executed as root through MDM (Mosyle)
  • local user with standard privileges was logged in at the time

I could fix it as mentioned by the OP by running

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -all local,system,user
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -seed

as local user (NOT root). The weird thing is that I did run it as

sudo -u localuser cmd

which is identical to what your script does... however, it seems to fail in your case for some obscure reason. So my solution is to simply run above commands at the end of my script...

@targendaz2
Copy link
Owner

I'm working on v2 of this app under the jxa-v2 branch. It should resolve this issue. I don't have an ETA at this time, but I'll follow up once it's released.

@popaprozac
Copy link
Author

Great thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants