Create The App Inside WSO under the uninstall script. Please use
!/bin/bash
#Generate application uninstallers for macOS.
#Parameters
DATE=`date +%Y-%m-%d`
TIME=`date +%H:%M:%S`
LOG_PREFIX="[$DATE $TIME]"
#Functions
log_info() {
echo "${LOG_PREFIX}[INFO]" $1
}
log_warn() {
echo "${LOG_PREFIX}[WARN]" $1
}
log_error() {
echo "${LOG_PREFIX}[ERROR]" $1
}
#Check running user
if (( $EUID != 0 )); then
echo "Please run as root."
exit
fi
echo "Welcome to Application Uninstaller"
echo "The following packages will be REMOVED:"
echo " VMware.Deem-21.12.191"
#Need to replace these with install preparation script
VERSION=21.12.191
PRODUCT=VMware.Deem
echo "Stopping the daemon: deemd"
set -e
/bin/launchctl unload "/Library/LaunchDaemons/com.vmware.deemd.plist"
rm /Library/LaunchDaemons/com.vmware.deemd.plist || true
echo "Application uninstalling process started"
# remove link to shorcut file
find "/usr/local/bin/" -name "deemd" | xargs rm
if [ $? -eq 0 ]
then
echo "[1/4] [DONE] Successfully deleted shortcut links"
else
echo "[1/4] [ERROR] Could not delete shortcut links" >&2
fi
#forget from pkgutil
pkgutil --forget "com.vmware.$PRODUCT.$VERSION" > /dev/null 2>&1
if [ $? -eq 0 ]
then
echo "[2/4] [DONE] Successfully deleted application informations"
else
echo "[2/4] [ERROR] Could not delete application informations" >&2
fi
#remove application source distribution
[ -e "/Library/Application Support/VMware/${PRODUCT}" ] && rm -rf "/Library/Application Support/VMware/${PRODUCT}"
if [ $? -eq 0 ]
then
echo "[3/4] [DONE] Successfully deleted application"
else
echo "[3/4] [ERROR] Could not delete application" >&2
fi
#remove deem log file
[ -e "/Library/Logs/VMware/Deem" ] && rm -rf "/Library/Logs/VMware/Deem"
if [ $? -eq 0 ]
then
echo "[4/4] [DONE] Successfully deleted logs"
else
echo "[4/4] [ERROR] Could not delete logs" >&2
fi
echo "Application uninstall process finished"
exit 0