Setting default applications?

jhuls
Contributor III

I need methods to set lab systems to use The Unarchiver for unzipping and Google Chrome for the default browser. I've searched through here and find references to com.apple.launchservices and duti and I keep coming up empty. I both can't seem to find this mythical com.apple.launchservices nor do I seem to know how to compile duti.

Does anyone have any experience with this that they can share? The labs are currently running High Sierra and this summer Mojave.

1 REPLY 1

Hugonaut
Valued Contributor II

Haven't done this in a very long time so please correct me if I'm wrong &/or missing a step - hope this helps

I believe by adding these lines to the users com.apple.launchservices.secure.plist (Located -> '/Users/$USERNAME/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure.plist ')

    <key>LSHandlerRoleAll</key>
                <string>-</string>
            </dict>
            <key>LSHandlerRoleAll</key>
            <string>com.google.Chrome</string>
            <key>LSHandlerURLScheme</key>
            <string>http</string>
        </dict>
        <dict>
            <key>LSHandlerPreferredVersions</key>
            <dict>
                <key>LSHandlerRoleAll</key>
                <string>-</string>
            </dict>
            <key>LSHandlerRoleAll</key>
            <string>com.google.Chrome</string>
            <key>LSHandlerURLScheme</key>
            <string>https</string>
        </dict>
        <dict>
            <key>LSHandlerPreferredVersions</key>
            <dict>
                <key>LSHandlerRoleAll</key>
                <string>-</string>
            </dict>
            <key>LSHandlerRoleAll</key>
            <string>com.google.Chrome</string>
            <key>LSHandlerURLScheme</key>
            <string>ftp</string>
        </dict>
        <dict>
            <key>LSHandlerContentType</key>
            <string>public.html</string>
            <key>LSHandlerPreferredVersions</key>
            <dict>
                <key>LSHandlerRoleAll</key>
                <string>-</string>
            </dict>
            <key>LSHandlerRoleAll</key>
            <string>com.google.Chrome</string>
        </dict>

& then deploying a plist (i did it with a config profile -> "Custom Settings" with the plist passed as is displayed in secure plist above ie "com.google.Chrome" - you want to save the plist as "com.google.chrome.plist" before uploading it.

Image Example Below - "Upload_Field_Custom_Settings_Filename" is where you upload the plist.

acb196f171164f34963b42651e5cb3a5

You can upload the following plist & config it how you see fit,

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>DefaultBrowserSettingEnabled</key>
    <false/>
    <key>HomepageIsNewTabPage</key>
    <false/>
    <key>HomepageLocation</key>
    <string>www.Website Homepage.com</string>
    <key>RestoreOnStartupURLs</key>
    <array>
        <string>www.Website 1.com</string>
        <string>www.Website 2.com</string>
        <string>www.Website 3.com</string>
    </array>
    <key>RestoreOnStartup</key>
    <integer>4</integer>
    <key>ShowHomeButton</key>
    <true/>
    <key>IncognitoModeAvailability</key>
    <integer>1</integer>
</dict>
</plist>
________________
Looking for a Jamf Managed Service Provider? Look no further than Rocketman
________________


Virtual MacAdmins Monthly Meetup - First Friday, Every Month