Office 2016 Packaging

24th January 2016

Clayton Burlison has written a better, more up to date and more comprehensive guide to Office 2016 for which significant kudos is due. I highly recommend that you read his post instead. As mentioned below, i’m leaving this behind for archival purposes only.

https://clburlison.com/demystify-office2016/

16th November 2015

The larger OS X admin community has recently been informed by Microsoft that the licence generation package inside the VL installer is generating the licence from machine specific items. As a result it is highly recommended that you do not follow this method anymore as it relies on copying the same licence file to multiple computers.

I’m leaving this article here for archival purposes only. Good progress has been made recently and so I hope these instructions will not be necessary shortly.

Article

Microsoft Office 2016 is the latest release of their 25 year old productivity suite for the OS X platform. It is by FAR one of the nastiest packaging jobs i’ve ever been forced into doing. The short version is that double click installs work and network deployable installs fail in various nasty ways which include missing out the volume license file, attempting to launch Word when installation is complete which breaks loginwindow deployments and a bunch of other things.

Microsoft. This is pretty unacceptable. Office 2011 installer never did this!

(I’ve been watching too much “Regular Car Reviews” on YouTube lately I swear.)

I have struggled. I have strained. I have invented new swear words. With the help of the macadmin community on Slack (inadvertently as I was ghosting the #microsoft-office channel for the most part), I have bent the Microsoft Office 2016 installation process to my will. And now you can do it too. You’ll need the following things:

 

  1. The Office 2016 installer. Volume Licence version is best. Version at time of writing is 15.12.2.
  2. My custom script that i’ll share further down this post.
  3. “Packages” by “Whitebox”
  4. AutoPkg with access to Arubdesu’s Office recipes.
  5. A sacrificial VM of OS X. Snapshots will save you.
  6. A lot of time to carry all of this out

 

Let’s start with a sacrificial VM of OS X. Hopefully you’ve a snapshot of it in it’s pristine first installed state but with the VM tools on it. Copy across the VL installer and run from the GUI. It is IMPERATIVE that you do not attempt to deploy it or run via the command line at this point, that’ll make it fail in various bad and horrible ways that I won’t go into here.

Navigate to /Library/Preferences/ and copy out the com.microsoft.office.licensingV2.plist file. That is your Volume Licence file. Keep this safe as you’ll need it later.

Ok now reset your VM back to default. You did snapshot earlier right? Cool. Excellent.

You won’t need the Office 2016 installer anymore. Put that somewhere else safe too if like me, you don’t have regular access to Microsoft’s VLSC.

Now you need to add and grab Arubdesu’s Office recipes for AutoPkg. What these will do is grab the updates for the individual Office applications, and since Microsoft has made these totally self contained they’re ideal for our purposes. They’re also the latest versions for good measure. They’ll take a while to download as there’s nearly 3Gb of applications there.

Create a folder somewhere convenient. This will be our project directory. In it place the following script saved as “postinstall.sh”.

(Apologies: Latest WordPress has seemingly broken all github plugins. As a result, i’ll have to link to my github for the file rather than inline post it.)

https://github.com/franton/Office-2016-Packaging/blob/master/postinstall.sh

FYI: I like local logging in addition to anything your management tool of choice does. Alter the variables at the top of the script to suit your own needs.

What this does is augment any Office 2011 uninstallation procedure you may have. The two Office versions can co-exist happily but Apple’s SSD laptops are … frankly short on space for my liking, so it goes. Notice I leave behind the user files as I dislike modifying/deleting things there and Lync users may be offended if their conversation histories disappear.

We need to open up Packages now and create a new raw package. Give it the following details:

Start with the Project Tab:

office2016-project

Give it the name: Microsoft Office 2016 15.13.1

Select the Settings tab:

Set the identifier xxx.xxx.pkg.MicrosoftOffice2016 (replacing the xxx parts with something more appropriate to where you are)

Set the version to match the version of Office that you are packaging. In my example this is 15.13.1.

Also tick the box for “Require admin password for installation

office2016-settings

 

Select the Payload tab:

Remember the office.licensingV2 file ? Drag it in here to the /Library/Preferences folder. Make sure it keeps it’s ownership and permissions (as pictured below). That’ll ensure your licensing is installed correctly. (Yes it really is just that one file!)

office2016-payload

Scripts: Add the postinstall.sh script from earlier here.

When AutoPkg has finished downloading the update recipes, drag those files into the “Additional Resources” section too. Make sure the package names match what’s in the script file!

office2016-scripts

Build the package and test!

Technical Note: I’m cheating slightly here. Microsoft in the name of sandboxing and probable future App Store deployments, has basically provided the full app bundles in the updates. All i’m doing is providing the license file and cleaning up old Office. This method has the advantage that it doesn’t install their pesky Auto Update Daemon which has a few flaws at present, thus leaving the admin to update as and when things are required. I’m not so much fixing the issue, as side stepping it.

Notes for Munki users: Get Munki to do a managed uninstall of Office 2011 as well. I ripped off William Smith’s script as I found it was leaving files behind, however it will remove any package receipts and other files that Munki is using to detect installations.