The postinstall script is a bit of a disaster (note the lack of indentation is in the original). The fact that it even mentions things in user space and has liberal sprinkling to tildes isn't a good sign. If this is something you pay for, get the developer to assist with how to get it installed properly. Otherwise the answer probably lies in here somewhere, likely around the gyrations to support both admins and non-admins installing the software.
#!/bin/sh
GLOBAL_APP_PATH="/Applications/ZoomOutlookPlugin/zOutlookPluginAgent.app"
USER_APP_PATH=~/Library/Application\ Support/ZoomOutlookPlugin/zOutlookPluginAgent.app
GLOBAL_APP_FOLDER="/Applications/ZoomOutlookPlugin"
USER_APP_FOLDER=~/Library/Application\ Support/ZoomOutlookPlugin
LOG_PATH=~/Library/Logs/zoomoutlookplugin.log
ALIAS_FILE_PATH=~/Desktop/ZoomOutlookPlugin
#define customize path
#define src file path
USER_AGENT_PATH="/Applications/ZoomOutlookPlugin/zOutlookPluginAgent.app"
USER_BUNDLE_PATH="$GLOBAL_APP_FOLDER/zOutlookPlugin.bundle"
USER_BUNDLE_PATH_64="$GLOBAL_APP_FOLDER/zOutlookPlugin64.bundle"
ZOOM_AGENT_PLIST_PATH="$GLOBAL_APP_FOLDER/us.zoom.pluginagent.plist"
ZOOM_SCRIPT_PATH="$GLOBAL_APP_FOLDER/zOLPluginInjection.osax"
#define dest file path
USER_SHARED_FOLDER="/Users/Shared/ZoomOutlookPlugin"
USER_SHARED_AGENT_PATH="$USER_SHARED_FOLDER/zOutlookPluginAgent.app"
USER_SHARED_BUNDLE_PATH="$USER_SHARED_FOLDER/zOutlookPlugin.bundle"
USER_SHARED_BUNDLE_PATH_64="$USER_SHARED_FOLDER/zOutlookPlugin64.bundle"
SYS_LAUNCHAGENTS_FOLDER="/Library/LaunchAgents"
SYS_LAUNCHAGENTS_PLIST_PATH="$SYS_LAUNCHAGENTS_FOLDER/us.zoom.pluginagent.plist"
SYS_SCRIPTADDITION_FOLDER="/Library/ScriptingAdditions"
SYS_SCRIPTADDITION_PATH="$SYS_SCRIPTADDITION_FOLDER/zOLPluginInjection.osax"
USER_LAUNCHAGENTS_FOLDER=~/Library/LaunchAgents
USER_LAUNCHAGENTS_PLIST_PATH="$USER_LAUNCHAGENTS_FOLDER/us.zoom.pluginagent.plist"
USER_APP_PLUGINLAUNCHER_PATH="$GLOBAL_APP_FOLDER/PluginLauncher.app"
USER_SHARED_PLUGINLAUNCHER_PATH="$USER_SHARED_FOLDER/PluginLauncher.app"
ZOLPLUGIN_LAUNCHER_RUN_PATH="$GLOBAL_APP_FOLDER/PluginLauncher.app/Contents/MacOS/PluginLauncher"
OLD_SYS_SCRIPTADDITION_PATH="$SYS_SCRIPTADDITION_FOLDER/zPluginScriptAddition.osax"
p=$(/usr/bin/printenv PATH)
echo "path: $p">$LOG_PATH
if [[ $p = *usr\/bin* ]] ; then
echo "The path includes /usr/bin.">>$LOG_PATH
else
PATH="/usr/bin:/bin:/usr/sbin:/sbin"
fi
p=$(/usr/bin/printenv PATH)
echo "path new: $p">>$LOG_PATH
w=$(whereis whoami)
echo "Where:$w">>$LOG_PATH
a=$(whoami 2>&1)
r=$?
if [ $r != 0 ] ; then
echo "get user name error: $r">>$LOG_PATH
a = $(/usr/bin/whoami 2>$1)
fi
checkUser=$(dsmemberutil checkmembership -U "$a" -G "admin")
isAdmin=0
isAdminUser=$(echo $checkUser | grep "is a member")
len=$(expr "$isAdminUser" : ".*")
echo "check admin:$a, $isAdmin, $checkUser, $isAdminUser, $len">>$LOG_PATH
if [[ $checkUser = *is\ a\ member* ]] ; then
mkdir -v -m 777 $GLOBAL_APP_FOLDER
echo "create /Applications/ZoomOutlookPlugin folder\n">>$LOG_PATH
APP_PATH=$GLOBAL_APP_PATH
APP_FOLDER=$GLOBAL_APP_FOLDER
DOCK_APPPATH="file://localhost/Users/Shared/ZoomOutlookPlugin/zOutlookPluginAgent.app/"
CUR_AGENTPLIST_PATH=$SYS_LAUNCHAGENTS_PLIST_PATH
CUR_AGENTPLIST_FOLDER=$SYS_LAUNCHAGENTS_FOLDER
isAdmin=1
else
if [[ ! -d $USER_APP_FOLDER ]] ; then
mkdir "$USER_APP_FOLDER"
else
echo "folder exists">>$LOG_PATH
fi
APP_PATH=$USER_APP_PATH
APP_FOLDER=$USER_APP_FOLDER
DOCK_APPPATH="file://localhost/Users/$a/Library/Application%20Support/ZoomOutlookPlugin/zOutlookPluginAgent.app"
CUR_AGENTPLIST_PATH=$USER_LAUNCHAGENTS_PLIST_PATH
CUR_AGENTPLIST_FOLDER=$USER_LAUNCHAGENTS_FOLDER
fi
permission=$(ls -lde "$APP_FOLDER")
echo "$permission">>$LOG_PATH
echo "["$(date)"]use this app path: $APP_PATH">>$LOG_PATH
echo "["$(date)"]use this folder path: $APP_FOLDER">>$LOG_PATH
echo "["$(date)"]use this dock path: $DOCK_APPPATH">>$LOG_PATH
function copyzoomoutlookpluginfiles(){
echo "enter copyzoomoutlookpluginfiles\n">>$LOG_PATH
#remove previous installed plugin for reinstall/update
if [[ -d $USER_SHARED_FOLDER ]] ; then
if [[ -d $USER_SHARED_AGENT_PATH ]] ; then
echo "delete $USER_SHARED_AGENT_PATH"
rm -rf $USER_SHARED_AGENT_PATH
fi
if [[ -d $USER_SHARED_BUNDLE_PATH ]] ; then
echo "delete $USER_SHARED_BUNDLE_PATH"
rm -rf $USER_SHARED_BUNDLE_PATH
fi
if [[ -d $USER_SHARED_BUNDLE_PATH_64 ]] ; then
echo "delete $USER_SHARED_BUNDLE_PATH_64"
rm -rf $USER_SHARED_BUNDLE_PATH_64
fi
rm -rf $USER_SHARED_FOLDER
fi
if [[ -d $SYS_SCRIPTADDITION_PATH ]] ; then
echo "delete $SYS_SCRIPTADDITION_PATH"
rm -rf $SYS_SCRIPTADDITION_PATH
fi
#end remove previous installed plugin files
echo "["$(date)"]result of remove ZoomOutlookPlugin: $?">>$LOG_PATH
if [[ ! -d $USER_SHARED_FOLDER ]] ; then
echo "Making $USER_SHARED_FOLDER"
mkdir -v -m 777 $USER_SHARED_FOLDER
echo "result of create "[$USER_SHARED_FOLDER]": $?">>$LOG_PATH
fi
if [[ ! -d $GLOBAL_APP_FOLDER ]] ; then
echo "Check ["$GLOBAL_APP_FOLDER"], it is existed.">>$LOG_PATH
fi
#start copy outlookplugin files
#start copy launch agent app to USER_SHARED_FOLDER
cp -afpR "$APP_PATH" "$USER_SHARED_AGENT_PATH"
echo "result of copy ["$APP_PATH"]: $?">>$LOG_PATH
touch $USER_SHARED_AGENT_PATH
chmod 777 $USER_SHARED_AGENT_PATH
rm -rf $APP_PATH
echo "result of delete ["$APP_PATH"]: $?">>LOG_PATH
#end copy launch agent app
#start copy bundle USER_SHARED_BUNDLE_PATH to USER_SHARED_FOLDER
cp -afpR "$USER_BUNDLE_PATH" "$USER_SHARED_BUNDLE_PATH"
touch $USER_BUNDLE_PATH
chmod 777 $USER_BUNDLE_PATH
echo "result of copy ["$USER_BUNDLE_PATH"]: $?">>$LOG_PATH
rm -rf $USER_BUNDLE_PATH
echo "result of delete ["$USER_BUNDLE_PATH"]: $?">>LOG_PATH
#end copy bundle
#start for 64bit outlook
#start copy bundle USER_SHARED_BUNDLE_PATH_64 to USER_SHARED_FOLDER
cp -afpR "$USER_BUNDLE_PATH_64" "$USER_SHARED_BUNDLE_PATH_64"
touch $USER_BUNDLE_PATH_64
chmod 777 $USER_BUNDLE_PATH_64
echo "result of copy ["$USER_BUNDLE_PATH_64"]: $?">>$LOG_PATH
rm -rf $USER_BUNDLE_PATH_64
echo "result of delete ["$USER_BUNDLE_PATH_64"]: $?">>LOG_PATH
#end copy bundle
#end for 64bit outlook
#remove old pluginscriptaddition file
if [[ -d $OLD_SYS_SCRIPTADDITION_PATH ]] ; then
rm -rf $OLD_SYS_SCRIPTADDITION_PATH
echo "result of delete ["$OLD_SYS_SCRIPTADDITION_PATH"]: $?">>LOG_PATH
fi
#end remove
#start copy scriptaddition ZOOM_SCRIPT_PATH to SYS_SCRIPTADDITION_FOLDER
cp -afpR "$ZOOM_SCRIPT_PATH" "$SYS_SCRIPTADDITION_PATH"
echo "result of copy ["$ZOOM_SCRIPT_PATH"]: $?">>$LOG_PATH
rm -rf $ZOOM_SCRIPT_PATH
echo "result of delete ["$ZOOM_SCRIPT_PATH"]: $?">>LOG_PATH
#end copy plist
#end copy outlookplugin files
#start copy plist ZOOM_AGENT_PLIST_PATH to SYS_LAUNCHAGENTS_FOLDER
if [[ ! -d $USER_LAUNCHAGENTS_FOLDER ]] ; then
echo "Making $USER_LAUNCHAGENTS_FOLDER"
mkdir -v -m 777 $USER_LAUNCHAGENTS_FOLDER
echo "result of create "[$USER_LAUNCHAGENTS_FOLDER]": $?">>$LOG_PATH
fi
#cp -afpR "$ZOOM_AGENT_PLIST_PATH" $USER_LAUNCHAGENTS_PLIST_PATH
#echo "result of copy ["$ZOOM_AGENT_PLIST_PATH"]: $?">>$LOG_PATH
#rm -rf $ZOOM_AGENT_PLIST_PATH
#echo "result of delete ["$ZOOM_AGENT_PLIST_PATH"]: $?">>LOG_PATH
#end copy plist
#registry launch agent as permanent process
#echo "Loading us.zoom.pluginagent.plist...\n">>$LOG_PATH
#/bin/launchctl load -wF -S Aqua "$USER_LAUNCHAGENTS_PLIST_PATH"
#echo "Result for Load ["$USER_LAUNCHAGENTS_PLIST_PATH"]: $?">>$LOG_PATH
#copy pluginlauncher to USER_APP_PLUGINLAUNCHER_PATH.
#cp -afpR "$USER_APP_PLUGINLAUNCHER_PATH" "$USER_SHARED_PLUGINLAUNCHER_PATH"
#touch $USER_APP_PLUGINLAUNCHER_PATH
#chmod 777 $USER_APP_PLUGINLAUNCHER_PATH
#echo "result of copy ["$USER_APP_PLUGINLAUNCHER_PATH"]: $?">>$LOG_PATH
#rm -rf $USER_APP_PLUGINLAUNCHER_PATH
#echo "result of delete ["$USER_APP_PLUGINLAUNCHER_PATH"]: $?">>LOG_PATH
#end copy pluginlauncher
echo "exit copyzoomoutlookpluginfiles, return 0\n">>$LOG_PATH
return 0
}
#copy zoomoutlookplugin files
copyzoomoutlookpluginfiles
open -a $ZOLPLUGIN_LAUNCHER_RUN_PATH --args -install
echo "open "$ZOLPLUGIN_LAUNCHER_RUN_PATH" result: $?">>$LOG_PATH
sleep 1
rm -rf $ZOOM_AGENT_PLIST_PATH
echo "result of delete ["$ZOOM_AGENT_PLIST_PATH"]: $?">>LOG_PATH
exit 0
####