Home > Mac administration, Office 2011, Packaging > Creating an Office 2011 SP 4 14.4.1 installer

Creating an Office 2011 SP 4 14.4.1 installer

One of the issues I worked on this week was building a new Office 2011 installer after Microsoft released the Office 2011 14.4.1 update. I have an existing process to build a combined Office 2011 installer using Packages, which I’ve used successfully for a while.

This time though, I hit a problem. When I installed the combined Office 2011 installer with DeployStudio, then logged in, I was asked to enter a product key. Since my work has a volume license, this isn’t a screen I should ever see.

Screen Shot 2014-04-09 at 5.38.23 PM

This is a problem that’s been seen with previous Microsoft Office 2011 installers and usually involves the volume license file not being applied when it should be. This behavior may be seen with the 14.4.1 update in the following cases:

1. Office 2011 is installed and then updated to 14.4.1 while nobody is logged in

2. Office 2011 is installed and then updated to 14.4.1 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.

With luck, this will only be an issue for 14.4.1 and Microsoft will fix this issue in the next 14.4.x update. In the meantime, the easiest fix I’ve found in my testing this week is to get the necessary volume license file from a machine that has Office 14.3.x installed on it and put it back on an as-needed basis.

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

Screen Shot 2014-04-09 at 4.17.48 PM

To address the issue of installing 14.4.1 without losing your volume license, you can use Packages‘ ability to add resources to a Packages-built package. See below the jump for how you can use an Office 2011 SP 3 installer package, the Office 2011 14.4.1 Update, and the com.microsoft.office.licensing.plist license file to build a unified Office 2011 SP 4 14.4.1 installer package that does not prompt for a product key.

1. Remove the Office 2011 installers’ application quit function.

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

Screen Shot 2014-04-09 at 4.12.25 PM

3. In this case, I’m naming the project Microsoft Office 2011 SP 4 14.4.1


Screen Shot 2014-04-09 at 6.27.44 PM


4. 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.)

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

Screen Shot 2014-04-09 at 4.12.57 PM

5. 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 2014-04-09 at 4.13.15 PM

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

Screen Shot 2014-04-09 at 6.13.29 PM

7. 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:

Office 2011 14.3.0 with Service Pack 3 Installer.pkg
Office 2011 14.4.1 Update.pkg

Screen Shot 2014-04-09 at 4.18.42 PM

8. Make a copy of the com.microsoft.office.licensing.plist file and drag it into the Additional Resources section of your Packages project.

Screen Shot 2014-04-09 at 4.19.15 PM

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


#!/bin/sh
# Determine working directory
install_dir=`dirname $0`
# Location of Microsoft Office Volume License file
office_license="$3/Library/Preferences/com.microsoft.office.licensing.plist"
# Backup location for Microsoft Office 2011 Volume License file
license_backup="$3/tmp/com.microsoft.office.licensing.plist"
/usr/sbin/installer -dumplog -verbose -pkg "$install_dir/Office 2011 14.3.0 with Service Pack 3 Installer.pkg" -target "$3"
# Copy a backup of the Microsoft Office 2011 Volume License file to /tmp. If the license file is
# not available as /Library/Preferences/com.microsoft.office.licensing.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.licensing.plist" "$license_backup"
fi
/usr/sbin/installer -dumplog -verbose -pkg "$install_dir/Office 2011 14.4.1 Update.pkg" -target "$3"
# If the Microsoft Office 2011 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.sh

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.licensing.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 2011 packages onto the desired drive. The $3 variable will also allow the installer to correctly determine if the com.microsoft.office.licensing.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 2011 installer runs first and the update runs 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.

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

sudo chmod a+x /path/to/postinstall

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

Screen Shot 2014-04-09 at 4.20.29 PM

12. 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.)

Screen Shot 2014-04-09 at 6.39.56 PM

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 2011 should be properly licensed and not prompt you for a product key.
  1. jhbush
    April 10, 2014 at 12:14 am

    Thanks for posting on this again.

  2. lashomb
    April 10, 2014 at 7:49 pm

    Good catch… thanks Rich!

  3. April 10, 2014 at 8:27 pm

    Hey Rich. Built a bit on what you’ve done to try to streamline things without having to recode with each update. You should be able to just drop in disk images you download from Microsoft and have an updated package: https://github.com/jschripsema/Public_Scripts/tree/master/Microsoft%20Office%20Install%20Wrapper

    Unfortunately, doesn’t really address the permissions or licensing issues. Going to try and go through these new packages and just correct the issues.

  4. Brian
    April 11, 2014 at 11:01 am

    Rich,

    Has MS released a combined installer yet for version 14.4.x? I like your method don’t get me wrong, but if they have, I’ll ask my boss to download the newest image.

    • April 11, 2014 at 11:32 am

      Brian,

      As of 7:30 AM EDT on Friday, April 11th, MS has not made a 14.4.x full installer available on the MS Volume Licensing site. Hopefully that changes soon.

    • neuralstatic
      April 14, 2014 at 4:28 pm

      that’s what i was wondering, Rich. Thanks Brian. i need to know everything this article outlined for all kinds of reasons, but hopefully i can can wait for MS to publish a full installer too.

  5. April 15, 2014 at 3:54 pm

    Rich, does the nochoices.xml approach you leveraged for earlier SP2 installers still work with the current releases? (re: https://derflounder.wordpress.com/2012/05/09/creating-an-updated-office-2011-sp-2-installer)

  6. Maik
    April 23, 2014 at 2:20 pm

    I’m not sure where this problem comes from but I can’t get (as in versions before) the all quite function to not appear…

    Any suggestions?

    Cheers

  7. May 27, 2014 at 7:21 pm

    Hey, how did you get a .pkg to install? Every MS installer is .mpkg. Did you repackage? Thanks!

  8. pcmacxplat
    May 28, 2014 at 2:42 pm

    Has anyone tested the 14.4.2 update to see if Microsoft resolved this issue?

  9. pcmacxplat
    May 28, 2014 at 4:47 pm

    Just tested on a system with a fresh install of Office 2011 SP3 and it does not prompt for a product key after updating to 14.4.2 like it did when updating to 14.4.1.

  10. t21drl
    June 18, 2014 at 1:14 pm

    sudo chmod a+x /path/to/postinstall doesn’t seem to change my postinstall.sh to an executable far as i can tell.

  11. Kostas Backas
    June 18, 2014 at 4:48 pm

    The script will be executed from the package itself after this.

  1. No trackbacks yet.

Leave a comment