Skip to content

Instantly share code, notes, and snippets.

@timsutton
Last active March 6, 2018 03:27
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save timsutton/b93ab415a61f83861616 to your computer and use it in GitHub Desktop.
Save timsutton/b93ab415a61f83861616 to your computer and use it in GitHub Desktop.
Office 2016 workarounds for MAU and the AU Daemon
<!-- This can be added to a Munki pkginfo so as to deselect the MAU component
from being installed. However, some version of MAU would be probably
already installed if Office 2011 had ever been installed on this system. -->
<key>installer_choices_xml</key>
<array>
<dict>
<key>attributeSetting</key>
<integer>0</integer>
<key>choiceAttribute</key>
<string>selected</string>
<key>choiceIdentifier</key>
<string>com.microsoft.autoupdate</string>
</dict>
</array>
<!-- Configuration Profile for registering all Office 2016 apps with
MAU and configuring MAU to check manually. With these settings, even
if MAU has been installed it should not periodically (or on an app's
first launch launch) check for updates. -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadContent</key>
<dict>
<key>com.microsoft.autoupdate2</key>
<dict>
<key>Set-Once</key>
<array>
<dict>
<key>mcx_data_timestamp</key>
<date>2015-09-23T13:44:54Z</date>
<key>mcx_preference_settings</key>
<dict>
<key>Applications</key>
<dict>
<key>/Applications/Microsoft Excel.app</key>
<dict>
<key>Application ID</key>
<string>XCEL15</string>
<key>LCID</key>
<integer>1033</integer>
</dict>
<key>/Applications/Microsoft OneNote.app</key>
<dict>
<key>Application ID</key>
<string>ONMC15</string>
<key>LCID</key>
<integer>1033</integer>
</dict>
<key>/Applications/Microsoft Outlook.app</key>
<dict>
<key>Application ID</key>
<string>OPIM15</string>
<key>LCID</key>
<integer>1033</integer>
</dict>
<key>/Applications/Microsoft PowerPoint.app</key>
<dict>
<key>Application ID</key>
<string>PPT315</string>
<key>LCID</key>
<integer>1033</integer>
</dict>
<key>/Applications/Microsoft Word.app</key>
<dict>
<key>Application ID</key>
<string>MSWD15</string>
<key>LCID</key>
<integer>1033</integer>
</dict>
<key>/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app</key>
<dict>
<key>Application ID</key>
<string>MSau03</string>
<key>LCID</key>
<integer>1033</integer>
</dict>
</dict>
<key>HowToCheck</key>
<string>Manual</string>
<key>LastUpdate</key>
<date>2015-09-02T02:30:15Z</date>
</dict>
</dict>
</array>
</dict>
</dict>
<key>PayloadEnabled</key>
<true/>
<key>PayloadIdentifier</key>
<string>MCXToProfile.511079c4-5ffa-41d3-b5ed-66259ecdda54.alacarte.customsettings.aa57baf8-cd0d-402d-ba77-2368774df9aa</string>
<key>PayloadType</key>
<string>com.apple.ManagedClient.preferences</string>
<key>PayloadUUID</key>
<string>aa57baf8-cd0d-402d-ba77-2368774df9aa</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</array>
<key>PayloadDescription</key>
<string>Sets the MAU agent to check manually only.</string>
<key>PayloadDisplayName</key>
<string>Microsoft Auto-Update: Check manually</string>
<key>PayloadIdentifier</key>
<string>MicrosoftAutoUpdate_Settings</string>
<key>PayloadOrganization</key>
<string></string>
<key>PayloadRemovalDisallowed</key>
<true/>
<key>PayloadScope</key>
<string>System</string>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>511079c4-5ffa-41d3-b5ed-66259ecdda54</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</plist>
#!/usr/bin/python
# A sample postinstall script for Office 2016 that will invoke lsregister
# on behalf of the currently-logged-in user. This is only useful when
# running the Office install while logged in and will not help if run at
# the loginwindow or for other users that may later launch Office apps.
# This postinstall script can be run as root after an Office 2016 install.
import os
import subprocess
import sys
from SystemConfiguration import SCDynamicStoreCopyConsoleUser
au_daemon_app_path = "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/Microsoft AU Daemon.app"
lsregister = "/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister"
for required_file in [au_daemon_app_path, lsregister]:
if not os.path.exists(required_file):
print >> sys.stderr, ("Expected '%s' to be present, but it is not. Exiting early."
% required_file)
sys.exit(0)
cfuser = SCDynamicStoreCopyConsoleUser(None, None, None)
current_user = cfuser[0]
if not current_user:
print "No GUI user present during postinstall. Exiting."
sys.exit(0)
try:
cmd = ["/usr/bin/sudo",
"-u",
current_user,
lsregister, "-R", "-f", "-trusted",
au_daemon_app_path]
subprocess.check_call(cmd)
except BaseException as err:
print >> sys.stderr, "Unhandled exception running lsregister:"
print >> sys.stderr, err
print >> sys.stderr, "Exiting 0 to avoid Munki logging an install failure."
sys.exit(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment