Dock Items w/ Installation

umassmed
New Contributor

Hello,

Is there a way to have newly installed software added to the dock automatically?

I am trying to do with Office 2011 and Firefox. I would like this to only happen during imaging and will let the users modify their dock as they please once they recieve their machines.

14 REPLIES 14

brandonusher
Contributor II

Try taking a look at a post by @Chris_Hafner here: https://jamfnation.jamfsoftware.com/discussion.html?id=7628#responseChild42532

You will have to customize the dock for a specific user then move the preferences over to the user template. That way when a user is created it automatically gets what you want on the dock.

You could also look into using "Dock Items" located in your JSS here: https://jss.yourcompany.com:8443/dockItems.html then deploy on logon and run "Once per User"

perrycj
Contributor III

Dockutil is probably your best bet. You can customize a script to run during imaging and set up the dock the way you want. It also will let the user customize the dock as they use the Mac going forward.

https://github.com/kcrawford/dockutil

It's really good stuff and pretty easy to use.

Chriskmpruitt
Contributor

I would read this thread once you start using Dockutil

https://jamfnation.jamfsoftware.com/discussion.html?id=10991

Chris_Hafner
Valued Contributor II

Thanks for the shout out @usher.br][/url][/url though I'm certainly not the only one who does this, and there are many ways to skin this particular cat. Regardless, I do prefer to modify the default user template when dealing newly deployed images. Otherwise I've seen a lot of folks using profiles as well. I find the profiles a bit awkward to manage at the moment as the generally accepted 'best practice' for dealing with them is to create a separate profile for each profile configured item. I'd love t be wrong there...

That said, there are positives and negatives for each. I'll even admit that I DO NOT provide dock shortcuts for MS Office specifically to encourage users to find either their applications folder of Launchpad. If they use Spotlight then they already know how to find their stuff (for better or worse).

P.S (edit) I somehow forgot to +1 dockutil!

calumhunter
Valued Contributor

i'd use dockutil 100%
dock items in casper a close second, only because the work required to get the dock items into casper admin is painful. What I can do in 2 seconds with a line in a script takes probably 15+ minutes by the time i get the software installed on a mac, run casper admin to get the dock item blah blah

profiles and user template for dock items - *shudders*

YMMV!

bentoms
Release Candidate Programs Tester

@umassmed, I install dockutil into:

/usr/local/bin/

Then run the following script via the JSS, with $4 being the path to the .app:

https://github.com/macmule/Dockutil-Add-App

Dockutil has loads more options & ways of being used. It's a great tool.

stevevalle
Contributor III

Anther way to customise the dock is to edit the ConfigurationProfileDockItemApps.xml file and use Configuration Profiles. A bit of a headache to setup, but once done, they work well.

daz_wallace
Contributor III

+1 for Dockutil.

for bonus points, on 10.9 I used an MCX to set the Dock to be un-changeable. This stops the user being able to move dock items around / remove them but, bizarrely, still let Dockutil setup the dock and modify it.

Not going to complain as it set the desired behaviour exactly as I needed for that client!

Darren

umassmed
New Contributor

Thank you all. Very helpful. I am going to try all these to see what works best.

What about for Self Service installers? Is there a workflow for adding the newly installed app to the dock?

stevevalle
Contributor III

@umassmed Add a dock item to the policy. Once the application installs, the dock items appear in the dock.

wmateo
Contributor

@Chris_Hafner

I want to modify the user template post deployment. I am deploying office 2016 to 2011 users, and I am using dockutil to add dock items to current user. You have a sample script on your approach to adding the dock to user templates?

Chris_Hafner
Valued Contributor II

@wmateo Yes, and no. While this could be scripted, I never found that to be "simple". Lately, I've been finding profiles to be my favorite solution when adding items to a user's dock. Although, if I'm to be fair, I try to leave the dock alone.

Something that I've found interesting: If I've installed something to the dock using a profile, I tend to let them remove said profile via self-service. This:

• Makes them feel in 'control' over their dock/computer, as profiles are a bit insistent
• Ensures that they KNOW they have a new app installed even if they don't want it on their dock.
• Keeps or makes them familiar with Self-Service
• Makes IT (and you) look great!

P.S. I'd love to give you specific advice on 2016, but I've yet to package that one. I know that I've captured the dock additions, via Composer in the past and set them to install FUT.

Josh_Smith
Contributor III

@wmateo This is how I removed 2011 dock icons from existing users and the User Template and replaced them with 2016 icons. It worked well...it probably should be cleaned up at least with an array and some for loops, but it got the job done at the time. (updated MS Remote Desktop at the same time).

If you can avoid modifying the user template that is probably ideal, but if that ship has sailed then this should help.

#!/bin/sh

dockutil="/yourPathToDockutil"
OUTLOOK2016="/Applications/Microsoft Outlook.app"
WORD2016="/Applications/Microsoft Word.app"
EXCEL2016="/Applications/Microsoft Excel.app"
POWERPOINT2016="/Applications/Microsoft PowerPoint.app"
ONENOTE2016="/Applications/Microsoft OneNote.app"
REMOTEDESKTOP="/Applications/Microsoft Remote Desktop.app"


#Remove 2011 icons for all users
"$dockutil" --remove 'Microsoft Outlook' --allhomes --no-restart
"$dockutil" --remove 'Microsoft OneNote' --allhomes --no-restart
"$dockutil" --remove 'Microsoft Word' --allhomes --no-restart
"$dockutil" --remove 'Microsoft Excel' --allhomes --no-restart
"$dockutil" --remove 'Microsoft PowerPoint' --allhomes --no-restart
"$dockutil" --remove 'Microsoft Remote Desktop Connection' --allhomes --no-restart
"$dockutil" --remove 'Microsoft Remote Desktop' --allhomes

sleep 2

#Add 2016 icons for all users
"$dockutil" --add "$REMOTEDESKTOP" --position beginning --allhomes --no-restart
"$dockutil" --add "$ONENOTE2016" --position beginning --allhomes --no-restart
"$dockutil" --add "$POWERPOINT2016" --position beginning --allhomes --no-restart
"$dockutil" --add "$EXCEL2016" --position beginning --allhomes --no-restart
"$dockutil" --add "$WORD2016" --position beginning --allhomes --no-restart
"$dockutil" --add "$OUTLOOK2016" --position beginning --allhomes


#Repeat for User Template - Remove 2011

"$dockutil" --remove 'Microsoft Outlook' --no-restart "/System/Library/User Template/English.lproj/Library/Preferences/com.apple.dock.plist"
"$dockutil" --remove 'Microsoft OneNote' --no-restart "/System/Library/User Template/English.lproj/Library/Preferences/com.apple.dock.plist"
"$dockutil" --remove 'Microsoft Word' --no-restart "/System/Library/User Template/English.lproj/Library/Preferences/com.apple.dock.plist"
"$dockutil" --remove 'Microsoft Excel' --no-restart "/System/Library/User Template/English.lproj/Library/Preferences/com.apple.dock.plist"
"$dockutil" --remove 'Microsoft PowerPoint' --no-restart "/System/Library/User Template/English.lproj/Library/Preferences/com.apple.dock.plist"
"$dockutil" --remove 'Microsoft Remote Desktop Connection' --no-restart "/System/Library/User Template/English.lproj/Library/Preferences/com.apple.dock.plist"
"$dockutil" --remove 'Microsoft Remote Desktop' --no-restart "/System/Library/User Template/English.lproj/Library/Preferences/com.apple.dock.plist"

#Repeat for User Template - Add 2016


"$dockutil" --add "$REMOTEDESKTOP" --position beginning --no-restart "/System/Library/User Template/English.lproj/Library/Preferences/com.apple.dock.plist"
"$dockutil" --add "$ONENOTE2016" --position beginning --no-restart "/System/Library/User Template/English.lproj/Library/Preferences/com.apple.dock.plist"
"$dockutil" --add "$POWERPOINT2016" --position beginning --no-restart "/System/Library/User Template/English.lproj/Library/Preferences/com.apple.dock.plist"
"$dockutil" --add "$EXCEL2016" --position beginning --no-restart "/System/Library/User Template/English.lproj/Library/Preferences/com.apple.dock.plist"
"$dockutil" --add "$WORD2016" --position beginning --no-restart "/System/Library/User Template/English.lproj/Library/Preferences/com.apple.dock.plist"
"$dockutil" --add "$OUTLOOK2016" --position beginning --no-restart "/System/Library/User Template/English.lproj/Library/Preferences/com.apple.dock.plist"

exit 0

IIRC dockutil has some functionality to replace a dock item, which would keep the icon in the same place instead of removing and re-adding them all at the beginning....I tried that first and switched to this method because the success rate was significantly higher.

mm2270
Legendary Contributor III

@Josh.Smith wrote:

IIRC dockutil has some functionality to replace a dock item, which would keep the icon in the same place instead of removing and re-adding them all at the beginning....I tried that first and switched to this method because the success rate was significantly higher.

I ended up needing to do something very similar in regards to updating the Dock with new Office 2016 icons (and removing the older 2011 versions) because of the same issue of wild inconsistency with dockutil. Sometimes it would flat out fail to change any of the Dock icons. Sometimes it would successfully update a couple of them but leave the others with ? icons. Sometimes it would remove old versions, but not put the new ones in place. I even had a case where my dock.plist got completely wiped out and when the Dock restarted it was literally back to the stock OS default version! For all these reasons, I reluctantly went with just removing all Office 2011 icons first, then putting the new ones in the front of the Dock. I had very much wanted to replace the existing versions so I could retain muscle memory for our clients, but just wasn't able to make it work reliably.