Last active
April 5, 2018 15:36
-
-
Save opragel/ee22cf3103f20ae2f45464d9e78688a8 to your computer and use it in GitHub Desktop.
lazy_install_microsoft_office2016vl.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CHOICES_XML_PATH="/tmp/office2016-choices.xml" | |
MSO2016_PKG_PATH="/tmp/microsoft_office2016_volumeinstaller.pkg" | |
MSO2016_SERIALIZER_PATH="/tmp/Microsoft_Office_2016_VL_Serializer.pkg" | |
INSTALLER_TARGET="/" | |
MAU_APP_PATH="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app" | |
DOUBLE_SECRET_MAU_PATH="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/Microsoft AU Daemon.app" | |
/usr/sbin/installer -applyChoiceChangesXML "$CHOICES_XML_PATH" -dumplog -verbose -pkg "$MSO2016_PKG_PATH" -target "$INSTALLER_TARGET" | |
/usr/sbin/installer -dumplog -verbose -pkg "$MSO2016_SERIALIZER_PATH" -target "$INSTALLER_TARGET" | |
defaults write /Library/Preferences/com.microsoft.Excel kSubUIAppCompletedFirstRunSetup1507 -bool true | |
defaults write /Library/Preferences/com.microsoft.onenote.mac kSubUIAppCompletedFirstRunSetup1507 -bool true | |
defaults write /Library/Preferences/com.microsoft.Outlook kSubUIAppCompletedFirstRunSetup1507 -bool true | |
defaults write /Library/Preferences/com.microsoft.Outlook FirstRunExperienceCompletedO15 -bool true | |
defaults write /Library/Preferences/com.microsoft.PowerPoint kSubUIAppCompletedFirstRunSetup1507 -bool true | |
defaults write /Library/Preferences/com.microsoft.Word kSubUIAppCompletedFirstRunSetup1507 -bool true | |
# Borrowed from https://gist.github.com/erikng/7cede5be1c0ae2f85435 | |
if [ -e "$MAU_APP_PATH" ]; then | |
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -R -f -trusted "$MAU_APP_PATH" | |
if [ -e "$DOUBLE_SECRET_MAU_PATH" ]; then | |
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -R -f -trusted "$DOUBLE_SECRET_MAU_PATH" | |
fi | |
fi | |
rm -rf "$CHOICES_XML_PATH" "$MSO2016_PKG_PATH" "$MSO2016_SERIALIZER_PATH" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment