Office 2016 using dockutil

bpavlov
Honored Contributor

Not sure if they did this in 2011. Just thought this was interesting:

Do a pkgutil --expand /path/to/Office2016installer.pkg /new/path/to/extract/to

  1. Right-click on the path you've extracted the installer to.
  2. Right-click "Office15_all_licensing.pkg" and "Show package contents"
  3. Go to the scripts folder and you will see dockutil and of course the postinstall script that calls it.
3 REPLIES 3

tnielsen
Valued Contributor

I saw that too. They simplified the hell out of their install scripts.

Most of the stuff doesn't do anything but check for valid OS versions and then the licensing model.

Have you noticed an inconsistencies when using dockutil during postinstall scripts? Sometimes it adds everything, other times it adds just a couple of the items. For instance, I used this code to remove existing office dock icons and re-add the 2016 version. Only Outlook was added.

killall cfprefsd
/usr/bin/dockutil --remove 'Microsoft Excel' --allhomes --no-restart
/usr/bin/dockutil --remove 'Microsoft Outlook' --allhomes --no-restart
/usr/bin/dockutil --remove 'Microsoft PowerPoint' --allhomes --no-restart
/usr/bin/dockutil --remove 'Microsoft Word' --allhomes --no-restart

/usr/bin/dockutil --add /Applications/Microsoft Excel.app --allhomes --no-restart
/usr/bin/dockutil --add /Applications/Microsoft Outlook.app --allhomes --no-restart
/usr/bin/dockutil --add /Applications/Microsoft PowerPoint.app --allhomes --no-restart
/usr/bin/dockutil --add /Applications/Microsoft Word.app --allhomes --no-restart
killall Dock

Kumarasinghe
Valued Contributor

Please put a delay in between command and see:
e.g.-

/usr/bin/dockutil --add /Applications/Microsoft Excel.app --allhomes --no-restart
/bin/sleep 5
/usr/bin/dockutil --add /Applications/Microsoft Outlook.app --allhomes --no-restart
/bin/sleep 5
/usr/bin/dockutil --add /Applications/Microsoft PowerPoint.app --allhomes --no-restart
/bin/sleep 5
/usr/bin/dockutil --add /Applications/Microsoft Word.app --allhomes --no-restart
/bin/sleep 5
killall Dock

tnielsen
Valued Contributor

That delay is key and I'm surprised I see so many others not adding it to the script. Without that delay not all of the icons get added to the dock. Seems terribly sporadic.