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.
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:
- Office 2016 is installed and then updated to 15.12.3 while nobody is logged in
- 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.
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.
2. In this case, I’m naming the project Microsoft Office 2016 15.12.3
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 4 – Configuring a project.)
In this example, I’m not changing any of the options from what is set by default.
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
5. Click on the Scripts tab in your Packages project.
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
7. Select the com.microsoft.office.licensingV2.plist file and drag it into the Additional Resources section of your Packages project.
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:
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.
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 3 – Creating a raw package project and Chapter 10 – Building 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.