Skip to content

Instantly share code, notes, and snippets.

@GrahamWalters
Last active July 23, 2017 15:19
Show Gist options
  • Save GrahamWalters/1803129a9eb64f5ad460d0d336d69c21 to your computer and use it in GitHub Desktop.
Save GrahamWalters/1803129a9eb64f5ad460d0d336d69c21 to your computer and use it in GitHub Desktop.
Place all MS Office apps in "Microsoft Office 2016". Place this file in that folder. Run as root
#!/bin/sh
if (( $EUID != 0 )); then
echo "Please run as root"
exit
fi
cd "/Applications/Microsoft Office 2016"
mkdir -p shared/DFonts \
shared/Fonts \
shared/Frameworks \
shared/SharedSupport
find . -type d -depth 1 -name "*.app" | { \
while read d; do \
rsync -vaur "$d/Contents/Resources/DFonts/" ./shared/DFonts;
rsync -vaur "$d/Contents/Resources/Fonts/" ./shared/Fonts;
rsync -vaur "$d/Contents/Frameworks/" ./shared/Frameworks;
rsync -vaur "$d/Contents/SharedSupport/" ./shared/SharedSupport;
rm -r "$d/Contents/Resources/DFonts" \
"$d/Contents/Resources/Fonts" \
"$d/Contents/Frameworks" \
"$d/Contents/SharedSupport"
ln -s ../../../shared/DFonts "$d/Contents/Resources/DFonts";
ln -s ../../shared/Fonts "$d/Contents/Resources/Fonts";
ln -s ../../shared/Frameworks "$d/Contents/Frameworks";
ln -s ../../shared/SharedSupport "$d/Contents/SharedSupport";
done; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment