Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
66 lines (50 sloc) 2.34 KB
# Wait a few seconds
/bin/sleep 3
# Check to see if MathType is installed. We don't want to make any changes if MathType is installed
if [ ! -f "/Applications/MathType 6/" ]; then
# Logic
# If it's not installed, let's go ahead and update stuff
# 1. Old version exists, new version doesn't exist - replace
# 2. Old version exists and new version exists - do nothing
# 3. Old version doesn't exit and new version doesn't exist - do nothing
# 4. New version in only - do nothing
# Array of office apps to replace in Dock
"Microsoft Word"
"Microsoft Excel"
"Microsoft PowerPoint"
"Microsoft Outlook"
# Initialize a test variable... we don't want to kill the dock unless we've made any changes
# Loop through the list of Office apps
for office_app in "${office_apps[@]}"
# Create the %20 version of the office app name
no_spaces="${office_app/ /%20}"
# See if the old version is in there
old_version=$(/usr/local/bin/dockutil --list | /usr/bin/grep -n "Microsoft%20Office%202011/$")
# See if the new version is in there
new_version=$(/usr/local/bin/dockutil --list | /usr/bin/grep -n "/Applications/$")
# If there is an old version but no new version...
if [ ! -z "$old_version" ] && [ -z "$new_version" ]; then
# Update the old version to the new one
/bin/echo "Replacing 2011 version of $office_app"
/usr/local/bin/dockutil --add /Applications/"$office_app".app --replacing "$office_app" --no-restart
# If the changes made is still 0, make it 1
if [ "$changes_made" == 0 ]; then
# End checking if no changes had been made before
# End checking if the old version of the Office app is there but not the new version
# End looping through the Office apps
# If there were changes made, kill the Dock
if [ "$changes_made" == 1 ]; then
/usr/bin/killall Dock
# End checking changes have been made
# End checking MathType isn't installed