Home > Mac administration, Office 2016, Packaging, Scripting > Creating an Office 2016 15.12.3 installer

Creating an Office 2016 15.12.3 installer

One of the issues I worked on this week was building a new Office 2016 installer after Microsoft began making Office 2016 available to its volume license customers. I have an existing process to build a combined Office 2011 installer using Packages, which I’ve used successfully for a while, so I decided to see if I could apply the same process to building an Office 2016 installer.

However, when I installed the combined Office 2016 installer with DeployStudio, then logged in, I was asked to sign into an account and activate Office. Since my work has a volume license, this isn’t a screen I should be seeing.

Screen Shot 2015 08 05 at 2 50 18 PM

This is a problem that I’ve seen before with previous Microsoft Office 2011 installers and usually involves the license file not being applied when it should be. This behavior is seen on Macs in the following cases:

  1. Office 2016 is installed and then updated to 15.12.3 while nobody is logged in
  2. Office 2016 is installed and then updated to 15.12.3 without any Office applications being launched between the initial installation and the update.

These two scenarios will likely apply if you’re building a new machine using an automated deployment tool, but likely will not if you’re a home user.

The easiest fix I’ve found in my testing is to get the necessary volume license file from a machine that has Office 2016 installed on it and put it back on an as-needed basis.

The needed file is /Library/Preferences/com.microsoft.office.licensingV2.plist. If you have a volume-licensed version of Office 2016 installed on your Mac, you should have this file.

Screen Shot 2015 08 05 at 2 49 40 PM

To address this issue, you can use Packages‘ ability to add resources to a Packages-built package. See below the jump for an example using an Office 2016 volume licensed installer package, the Office 2016 15.12.3 updates for Excel, OneNote, Outlook, PowerPoint, and Word, as well the com.microsoft.office.licensingV2.plist license file to build a unified Office 2016 15.12.3 installer package that does not prompt for a product key.

1. Set up a new Packages project and select Raw Package.

Screen Shot 2015 08 05 at 2 35 33 PM

2. In this case, I’m naming the project Microsoft Office 2016 15.12.3

Screen Shot 2015 08 05 at 2 35 45 PM

3. Once the Packages project opens, click on the Project tab. You’ll want to make sure that the your information is correctly set here (if you don’t know what to put in, check the Help menu for the Packages User Guide. The information you need is in Chapter 4Configuring a project.)

In this example, I’m not changing any of the options from what is set by default.

Screen Shot 2015 08 05 at 2 35 57 PM

4. Next, click on the Settings tab. In the case of my project, I want to install with root privileges and not require a logout, restart or shutdown.

To accomplish this, I’m choosing the following options in the Settings section:

  • In the Post-Installation Behavior section, set On Success: to Do Nothing
  • In the Options section, check the box for Require admin password for installation

Screen Shot 2015 08 05 at 2 36 04 PM

5. Click on the Scripts tab in your Packages project.

Screen Shot 2015 08 05 at 3 25 38 PM

6. Select your installers and drag them into the Additional Resources section of your Packages project.

In the case of my example, I’m selecting the following installers:

  • Microsoft_Office_2016_15_11_2_Volume_Installer.pkg
  • Microsoft_Excel_15.12.3_Updater.pkg
  • Microsoft_OneNote_15.12.3_Updater.pkg
  • Microsoft_Outlook_15.12.3_Updater.pkg
  • Microsoft_PowerPoint_15.12.3_Updater.pkg
  • Microsoft_Word_15.12.3_Updater.pkg

Screen Shot 2015 08 05 at 2 52 51 PM

7. Select the com.microsoft.office.licensingV2.plist file and drag it into the Additional Resources section of your Packages project.

Screen Shot 2015 08 05 at 2 53 26 PM

8. The last piece is telling the installers to run and for the com.microsoft.office.licensingV2.plist file to be fixed as needed. For this, you’ll need a postinstall script. Here’s the one I’m using:


#!/bin/bash
# Determine working directory
install_dir=`dirname $0`
# Location of Microsoft Office 2016 Volume License file
office_license="$3/Library/Preferences/com.microsoft.office.licensingV2.plist"
# Backup location for Microsoft Office 2016 Volume License file
license_backup="$3/tmp/com.microsoft.office.licensingV2.plist"
/usr/sbin/installer -dumplog -verbose -pkg $install_dir/"Microsoft_Office_2016_15_11_2_Volume_Installer.pkg" -target "$3"
# Copy a backup of the Microsoft Office 2016 Volume License file to /tmp. If the license file is
# not available as /Library/Preferences/com.microsoft.office.licensingV2.plist, restore from the
# backup license file included with this installer.
if [[ -f "$office_license" ]]; then
cp "$office_license" "$license_backup"
fi
if [[ ! -f "$office_license" ]]; then
cp "$install_dir/com.microsoft.office.licensingV2.plist" "$license_backup"
fi
/usr/sbin/installer -dumplog -verbose -pkg $install_dir/"Microsoft_Excel_15.12.3_Updater.pkg" -target "$3"
/usr/sbin/installer -dumplog -verbose -pkg $install_dir/"Microsoft_OneNote_15.12.3_Updater.pkg" -target "$3"
/usr/sbin/installer -dumplog -verbose -pkg $install_dir/"Microsoft_Outlook_15.12.3_Updater.pkg" -target "$3"
/usr/sbin/installer -dumplog -verbose -pkg $install_dir/"Microsoft_PowerPoint_15.12.3_Updater.pkg" -target "$3"
/usr/sbin/installer -dumplog -verbose -pkg $install_dir/"Microsoft_Word_15.12.3_Updater.pkg" -target "$3"
# If the Microsoft Office 2016 Volume License file has been removed from its proper
# location, restore it using the backup file stored in /tmp and then set the correct
# permissions on the file.
if [[ ! -f "$office_license" ]] && [[ -f "$license_backup" ]]; then
cp "$license_backup" "$office_license"
chown root:wheel "$office_license"
fi
# Remove the backup file from /tmp
if [[ -f "$license_backup" ]]; then
rm "$license_backup"
fi
exit 0

view raw

gistfile1.txt

hosted with ❤ by GitHub

Notice that $install_dir in the postinstall script refers to the path to the package’s working directory. That’s where Packages will be storing the installers along with the com.microsoft.office.licensingV2.plist file, inside the Package-built installer’s embedded directory where it stores the items defined in the Additional Resources section.

The -target value is defined as “$3” because some information is passed along by the Packages-built installer to its included scripts when those scripts are run by the installation process. (For more information, see the PackageMaker How-To available here and search on the page for $3)

In this case, -target being defined as “$3” means that the postinstall script will install the two Office 2016 packages onto the desired drive. The $3 variable will also allow the installer to correctly determine if the com.microsoft.office.licensingV2.plist license file is in the right place on the target drive and take appropriate action if it isn’t.

The script also governs what order the installers run in, so the main Office 2016 installer runs first and the updates run next after the first job finishes. The -dumplog and -verbose flags are to help you track the progress of installation if you’re looking at the installer log.

9. Once you’ve got the postinstall script built, run the following command to make the script executable:

sudo chmod a+x /path/to/postinstall

10. Once completed, add the postinstall script to your Packages project.

Screen Shot 2015 08 05 at 2 53 26 PM

11. Last step, go ahead and build the package. (If you don’t know to build, check the Help menu for the Packages User Guide. The information you need is in Chapter 3Creating a raw package project and Chapter 10Building a project.)


Testing

Once you have the package built, you should be able to test it by installing it on a machine while the machine is logged out. Once installed, Office 2016 15.12.3 should be properly licensed and not prompt you for a product key.

  1. August 6, 2015 at 12:27 am

    Volume licensing is available for 2016? I don’t have access to our volume licensing service center, so I can’t check for myself, but they were supposed to add it before August 8.

  2. Tom
    August 6, 2015 at 8:22 am

    2016 became available on our volume licensing portal yesterday and I had this problem as soon as I installed it on a test client. Thank you so much! Do you have any advice as to disabling the sign in prompt? I’ve tried to hunt for changed property lists but I can’t find any pertaining to the usual com.microsoft.excel/powerpoint/word files that 2011 used so abundantly. Cheers.

  3. August 6, 2015 at 1:58 pm

    Also, is your postinstall script missing?

  4. August 6, 2015 at 2:13 pm

    Explains it; we have what you might call a “unique” solution in place to allow read-access to github, so I can’t see anything on gist at this time. I’ll check from home.

  5. August 6, 2015 at 5:14 pm

    I packaged the licensing plist into it’s own install package and set it as a required install for each of the 2016 apps in Munki. So far haven’t run into any issues with new installs or licensing users that were on the preview. Using an autopkg recipe to populate Munki with the individual 2016 Office apps (https://github.com/autopkg/arubdesu-recipes).

  6. Daniel Greening
    August 6, 2015 at 8:12 pm

    This process worked well for me. One minor thing which I am seeing on a freshly imaged Mac (with the 2016 package) is that the Microsoft AU Daemon asks for permission to run for the first time when launching Word for the first time. Is this in line with what you guys are seeing?

    • Mark Spidle
      October 15, 2015 at 7:35 pm

      I’m seeing this same issue when installing as DeployStudio package (post installation) Didnt’ see it when running the package manually when logged in.

  7. cashxx
    August 6, 2015 at 11:02 pm

    Been waiting for ours to hit our volume license site and no luck yet! Checked about 1/2 hour ago and still not in there. Glad to hear its slowly going out finally!

    • cashxx
      August 6, 2015 at 11:25 pm

      Doh!…..I have been searching for “office for mac”. I just did 2016 and found it. Better way to search it would be “microsoft office 2016 for mac” or “microsoft office” worked as well. Been on ours since the 3rd….lol

      • August 19, 2015 at 8:33 pm

        Apparently not all accounts have been updated… I checked on our VL for our Enterprise Agreement and it’s not there. LAME.

  8. cashxx
    August 7, 2015 at 6:40 am

    Disable first run dialogs if you haven’t seen this: http://macops.ca/disabling-first-run-dialogs-in-office-2016-for-mac/

    • Joe
      August 13, 2015 at 3:57 pm

      Based on this info I added these lines to my script to avoid both the first-run and autoupdate nags. Maybe it will be useful for someone else…

      # Set Office 2016 First Run Items as Completed
      defaults write /Library/Preferences/com.microsoft.Word kSubUIAppCompletedFirstRunSetup1507 -bool true
      defaults write /Library/Preferences/com.microsoft.Excel kSubUIAppCompletedFirstRunSetup1507 -bool true
      defaults write /Library/Preferences/com.microsoft.PowerPoint kSubUIAppCompletedFirstRunSetup1507 -bool true
      defaults write /Library/Preferences/com.microsoft.onenote.mac kSubUIAppCompletedFirstRunSetup1507 -bool true

      # Set Office 2016 Auto Update to Manual
      defaults write /Library/Preferences/com.microsoft.autoupdate2 HowToCheck Manual

  9. Joe
    August 7, 2015 at 6:37 pm

    Using this method I’m not getting the Microsoft AutoUpdate app installed. Only items in /Library/Application Support/Microsoft/ are an empty PlayReady folder and a SilverLight folder. No option in the Help menu to “Check for Updates”.

    • Troy
      August 10, 2015 at 6:47 pm

      Joe, I had the same issue and found that I needed to modify the Office Volume installer name in the posted script. Rich must have modified the name from the original download to identify the version.

      • Joe
        August 13, 2015 at 3:54 pm

        So, rename in the script and rebuild then?

  10. Jay
    August 7, 2015 at 11:11 pm

    Is it possible to modify the script so it can install custom office 2016, using a
    -applyChoiceChangesXML plist file. If so where and how would I make the change?

  11. MiqViq
    August 11, 2015 at 10:48 am

    I deploy 2 versions of Office 2016, one with Outlook (for Staff, no installer-choices mods) and another without Outlook (with installer-choices mods).
    I am deploying with Munki.
    So my working and tested mod for Office without Outlook pkginfo is:

    installer_choices_xml

    attributeSetting
    0
    choiceAttribute
    selected
    choiceIdentifier
    com.microsoft.outlook

    • Jay
      August 11, 2015 at 1:37 pm

      Thanks for the info, can you paste your entire pkginfo? I want to make sure I get it right.
      Thanks

  12. Rq
    August 11, 2015 at 11:52 pm

    I had an office 365 account when I initially installed Office 2016. Now that the volume licensed version is available I can’t seem to get past the activation screen after after completely removing the 365 version and installing the volume license.

    Has anyone seen this issue?

  13. August 18, 2015 at 11:37 pm

    I’ve gone through all the steps, but changes the scripts to trigger 15.13.1 update instead. The package still fails to install when I upload to casper though… Can you please help!

    To build the project, i’ve just been going Build Menu > Build…is this correct?

  14. August 20, 2015 at 1:36 pm

    I just packaged the 15.13.1 installer from 365 and the VL plist file up into one policy in our JSS and it works like a charm. saved roughly 3GB of space by not having to include the udpate files.

  15. Potige Aap
    August 28, 2015 at 12:57 pm

    Thanks for this method… after installing the created package on a frsshly installed system onenote asks to sign in…. but whenever i chooses sign in a never ending spinning wheel occurs. If you sign in from the menu item it seems to work but after that onenote keeps crashing randomly……bump

    • August 29, 2015 at 3:48 am

      Warning, logging into OneNote 2016 overrode the volume license and I had to restore the com.microsoft.office.licensingV2.plist to /Library/Preferences! Apparently you have to login to a Live account to use OneNote 2016. This is a major bummer, my employer refuses to allow cloud storage of any kind. Anyone know of a solution? Anyway to disable the sign-in prompts on the other Office 2016 applications? I’m likely going to need to remove OneNote from the installer package until I can find a solution. There has got to be enterprise configuration options but I am not finding anything yet. My employer can’t be the only one who refuses to allow OneDrive or logging into a Live account.

  16. Brian
    September 9, 2015 at 2:54 pm

    Have learned a bit more about the Office 2016 installer by combining Rich’s original post with some of my own research. Have shared my findings here in this JAMFNation thread: https://jamfnation.jamfsoftware.com/discussion.html?id=16761

  17. October 14, 2015 at 4:05 pm

    It might be wise to include the new Auto Update 3.0 updater in the package. That just came out prior to the 15.15.0 updates for all the apps. I have not yet tested this but you do need to install the AutoUpdate update before the 15.15.0 updates will show up if you are doing a manual install.

  18. Jachk
    January 5, 2016 at 9:42 pm

    Hi Rich, can we use the same approach with the new Office 2016 15.17 VLSC installer?
    Wondering if I can just build a package with the VL installer and Word and Outlook updaters. Along with those, the reviewed postinstall script (basically just the installer -pkg command).
    What do you think?
    Thanks for your help.

  19. Pascal Odermatt
    March 4, 2016 at 9:56 am

    Hi Guys

    Where do i get the updater.pkg. I only find the 15.12.3 but there has to be newer onces…
    any hint?

  20. January 14, 2019 at 7:48 pm

    Clearly this is a way outdated thread but hoped to see a post about what / how folks are deploying the Office 365 pkg. Tried a straight up pkg and it just doesn’t work. Not sure if composer is needed or what.

  1. No trackbacks yet.

Leave a reply to Jay Cancel reply