Files
Alte_Skripte/de.ing.office.update 2.sh
2026-02-16 15:05:15 +01:00

63 lines
2.3 KiB
Bash

#!/bin/bash
##########################################################################
# Shellscript : Microsoft Office installieren
# Autor : Jobst Heinermann, macenterprise gmbh
##########################################################################
# Anmerkung:
# das komplette Paket kann hier (https://macadmins.software) geladen werden
# mit der Datei "de.ing.office.choices.xml" werden bestimmte
# Bestandteile bei der Installation ausgeschlossen
# Close MS Office Word if run
if ( pgrep "Microsoft Word" > /dev/null ); then
echo "Killing Microsoft Word"
osascript -e 'quit app "Microsoft Word"'
else
echo "Microsoft Word is not running"
fi
# Variabeln
OFFICE=/Library/Application\ Support/JAMF/Waiting\ Room/Microsoft_Office_16.28.19081202_Installer.pkg
LIC=/Library/Application\ Support/JAMF/Waiting\ Room/Microsoft_Office_2019_VL_Serializer.pkg
XML=/Library/Application\ Support/JAMF/de.ing.office_choices.xml
echo ""
echo "Installation Microsoft Office gestartet ..."
# Software installieren
/usr/sbin/installer -pkg "$OFFICE" -applyChoiceChangesXML "$XML" -allowUntrusted -target /
echo ""
echo "Installation beendet"
# Lizenz installieren
/usr/sbin/installer -pkg "$LIC" -target /
echo ""
echo "Lizenz installiert"
# "First Run" Nachrichten unterdrücken
# Microsoft Word
defaults delete com.microsoft.Word kSubUIAppCompletedFirstRunSetup1507
defaults write /Library/Preferences/com.microsoft.Word kSubUIAppCompletedFirstRunSetup1507 -bool true
# Microsoft Excel
defaults delete com.microsoft.Excel kSubUIAppCompletedFirstRunSetup1507
defaults write /Library/Preferences/com.microsoft.Excel kSubUIAppCompletedFirstRunSetup1507 -bool true
# Microsoft PowerPoint
defaults delete com.microsoft.PowerPoint kSubUIAppCompletedFirstRunSetup1507
defaults write /Library/Preferences/com.microsoft.PowerPoint kSubUIAppCompletedFirstRunSetup1507 -bool true
# "Default Save & Open" auf lokale Festplatte
/usr/bin/defaults write /Library/Preferences/com.microsoft.office DefaultsToLocalOpenSave -bool true
# Nach der Installation, sollen die benötigten Pakete wieder gelöscht werden.
rm -rf /Library/Application\ Support/JAMF/de.ing.office_choices.xml
rm -rf /Library/Application\ Support/JAMF/Waiting\ Room/Microsoft_Office_16.28.19081202_Installer.pkg
rm -rf /Library/Application\ Support/JAMF/Waiting\ Room/Microsoft_Office_2019_VL_Serializer.pkg