@jhuls you can set it up in the JSS as a managed preference (Managed Preference > Internet Configuration > Default Web Browser) and then if not done already setup the iMacs in that lab into a Static Computer group and just scope the managed preference to the lab.
Thanks...somehow I missed that.
After posting this I did find a command line app called duti that looks like it might let me do the same thing but I'll definitely explore both to see which one I prefer.
Thanks again!
I believe the plist that holds the default browser setting is ~/Library/Preferences/com.apple.LaunchServices.plist. We create a modified dmg of this plist and deploy it to FEU and FUT. As you state, there are usually several options to complete a single task. Good luck. -Mark
I just came across this on my Mavericks install while snooping around. Deploying via dmg is an interesting option as well. Thanks!
Almost all of my administration experience has been in the Windows world so I'm still wrapping my head around how things get done on this side of the fence and what my options are. I think I need to find a good resource for learning more about preferences and plists and what's in them. In the Windows world group policies and preferences are pretty simple to work with and fairly well explained and if it's not enough you just dig into the registry. Here it seems thus far it's not quite as intuitive on the administration side.
Thanks again!
I know this is an old post, but maybe just maybe someone like me is stuck with Yosemite, and comes across this.
Run the following lines in a login script to set the browser as default for each user.
Assuming Chrome is already installed:
open -a "Google Chrome" --args --make-default-browser
sleep 1
sqlite3 /Library/Application Support/com.apple.TCC/TCC.db "REPLACE INTO access VALUES('kTCCServiceAccessibility','com.apple.loginwindow',0,1,1,NULL);"
osascript -e 'tell application "System Events" to tell process "CoreServicesUIAgent" to tell window 1 to click button 1' >/dev/null 2>&1
sqlite3 /Library/Application Support/com.apple.TCC/TCC.db "delete from access where client='com.apple.loginwindow';"
Very subtle solution and works quite nicely.
Kamal
This is exactly the thing that duti is for.
Install the binary, then run something like the below triggered via a launchAgent.
duti -s com.google.chrome public.html all
Thanks @greatkemo and @bentoms . I just got a lab in of Yosemite based systems and have to deal with this now. Your posts are timely...I'll give them a try...thanks!
It's worth mentioning the in El Capitan they added another table so you just add an additional NULL:
open -a "Google Chrome" --args --make-default-browser
sleep 1
sqlite3 /Library/Application Support/com.apple.TCC/TCC.db "REPLACE INTO access VALUES('kTCCServiceAccessibility','com.apple.loginwindow',0,1,1,NULL,NULL);"
osascript -e 'tell application "System Events" to tell process "CoreServicesUIAgent" to tell window 1 to click button 1' >/dev/null 2>&1
sqlite3 /Library/Application Support/com.apple.TCC/TCC.db "delete from access where client='com.apple.loginwindow';"
sorry to interrupt the discussion since we have 10.10.4 script runs without any errors but still safari is default browser and when I click on the Chrome it asks if I want to make it default.
@eukatc I know this post has been a few years now, but would your solution still work today? on Sierra ? wanting to set Google Chrome as the default browser?
I am trying your solution, using the below value to set the managed preferences --> internet configuration --> default web browser
it doesn't seem to do anything anyways. I scope it to a test group of 2 computers and I check system preferences --> general -- Safari is still listed as the default web browser.
here is another question; whats the point of setting the default web browser? the user can use whatever browser they want !! we have Safari,Firefox and Google Chrome installed!! how would setting the default web browser help if a user prefers to use a different browser over the browser I want to set as default ???
We have a certain Web application that works better in Google Chrome versus Safari -- so this is why I want to set the default browser. But if the user uses Safari to access that web application, what is the point of setting Google Chrome as the default browser?
"/Applications/Google Chrome.app"
@tcandela haven't tested it on Sierra but don't see no reason why it wouldn't work, thats the right file path for the config
In macOS 10.12 the plist that holds the default browser settings has moved to: ~/Library/Preferences/com.apple.LaunchServices/com.apple.LaunchServices.plist.
-Mark
@mark.sampers I went to that location and the com.apple.LaunchServices folder was empty, so I went to system preferences --> General and changed the default web browser from Safari to Google Chrome. Upon making this change, immediately a file was created in this empty folder
com.apple.launchservices.secure.plist
what process did you do to create your dmg? I don't need it to mess with FEU just want it setup for newly configured macs from this point on. so would it be FUT ?
do i just drag that .plist file into Composer ?
@tcandela I used the same process you described. FUT would work. I normally use check both FEU and FUT in case a package needs to be pushed out before a re-image.
@mark.sampers thanks, I am clear on the FEU/FUT option i want to select, but in order to create the dmg do i just simply drag the file com.apple.launchservices.secure.plist from the com.apple.LaunchServices folder into composer
@tcandela Yes, drag the plist into composer and create the dmg. Note: I normally create the package using a local management account that is part of our base macOS. (Doing so allows the package to be installed properly during imaging. At least in our work flows.)
@mark.sampers ok. dmg created.
When saving it into Casper Admin would i check the box INSTALL ON BOOT DRIVE AFTER IMAGING ?
@mark.sampers ok. dmg created.
When saving it into Casper Admin would i check the box INSTALL ON BOOT DRIVE AFTER IMAGING ?
You could also try using lsregister. I don't have specific examples as I've just started looking into it as well but there is a frontend called duti for it.
Details here: http://krypted.com/mac-security/lsregister-associating-file-types-in-mac-os-x/
I normally don't. (Again, this is the reason I create the package using a local management/admin account that is part of our base OS.) Your environment may be different. You'll want to test the package and adjust it if needed. Good Luck.
@mark.sampers i tested it via creating a policy, then i manually created 2 accounts, logged into each account and checked system preferences --> General and the default web browser set to Google Chrome
I created a web link in a word document, Google Chrome opened, but then i was greeted with 2 popups
1 - this is an application open from the internet, do you want to open it .............. you know that popup message
2 - do you want to make Google Chrome as your default browser
how would i get rid of these 2 ugly popups ?
@mark.sampers i tested it via creating a policy, then i manually created 2 accounts, logged into each account and checked system preferences --> General and the default web browser set to Google Chrome
I created a web link in a word document, Google Chrome opened, but then i was greeted with 2 popups
1 - this is an application open from the internet, do you want to open it .............. you know that popup message
2 - do you want to make Google Chrome as your default browser
how would i get rid of these 2 ugly popups ?
@tcandela Those pop-ups are probably related to your Google Chrome package. When creating a Google Chrome package, I will normally launch Chrome and adjust settings before packaging with Composer. Depending on your needs, the "Pre-installed Software" option in Composer may help package Google Chrome.
@mark.sampers I see now. My google chrome installs on each computer after enrollment using a script that was pulled from the jamf nation scripts. It runs monthly to check to see if each computer is running the latest version, if not it updates it with the latest version.
Since this computer was just enrolled, and the first time google chrome was run from that user account that is why those pop-ups appeared.
I like using this script over having to make new package each time
Not sure if you want this or not, but if you want Chrome to autoupdate, below is a script I found from Hannes Juutilainen. https://github.com/hjuutilainen/adminscripts/blob/master/chrome-enable-autoupdates.py