#!/bin/bash
#
/bin/mkdir -p "${HOME}/Desktop/downloadfromjamf"
cd "${HOME}/Desktop/downloadfromjamf"
if [ ! -d "${HOME}/Desktop/Library/Containers/com.microsoft.Word/Data/Documents/wef" ]; then
/bin/mkdir -p "${HOME}/Desktop/Library/Containers/com.microsoft.Word/Data/Documents/wef"
fi
if [ ! -d "${HOME}/Desktop/Library/Containers/com.microsoft.Powerpoint/Data/Documents/wef" ]; then
/bin/mkdir -p "${HOME}/Desktop/Library/Containers/com.microsoft.Powerpoint/Data/Documents/wef"
fi
/bin/cp -a "./manifest_luxword.xml" "${HOME}/Desktop/Library/Containers/com.microsoft.Word/Data/Documents/wef"
/bin/cp -a "./manifest_luxppt.xml" "${HOME}/Desktop/Library/Containers/com.microsoft.Powerpoint/Data/Documents/wef"
(/usr/bin/osascript -e 'display dialog "成功安装office luxai 插件,请重启word和ppt,选择 \"开始(或插入)>加载项>开发人员加载项\",然后从菜单中选择加载项!特别说明:Office 每次重新启动,需要从 \"主页>加载项\"中打开加载项。您可以删除桌面上的downloadfromjamf目录,如果出现错误,请重启电脑!" buttons {"OK"} default button "OK"')
#把文件夹权限置为 777 ,让所有人可以删
sudo chmod -R 777 "${HOME}/Desktop/downloadfromjamf/"
#cd ../
#rm -Rf "${HOME}/Desktop/downloadfromjamf"
exit 0