zoom

[zoom]キャッシュクリア


#!/bin/bash
#com.cocolog-nifty.quicktimer.icefloe
#
#################################################
###管理者インストールしているか?チェック
USER_WHOAMI=$(/usr/bin/whoami)
/bin/echo "実行ユーザー(whoami): $USER_WHOAMI"
###実行しているユーザー名
CONSOLE_USER=$(/bin/echo "show State:/Users/ConsoleUser" | /usr/sbin/scutil | /usr/bin/awk '/Name :/ { print $3 }')
/bin/echo "コンソールユーザー(scutil): $CONSOLE_USER"
###実行しているユーザー名
HOME_USER=$(/bin/echo "$HOME" | /usr/bin/awk -F'/' '{print $NF}')
/bin/echo "実行ユーザー(HOME): $HOME_USER"
###logname
LOGIN_NAME=$(/usr/bin/logname)
/bin/echo "ログイン名(logname): $LOGIN_NAME"
###UID
USER_NAME=$(/usr/bin/id -un)
/bin/echo "ユーザー名(id): $USER_NAME"
###STAT
STAT_USR=$(/usr/bin/stat -f%Su /dev/console)
/bin/echo "STAT_USR(console): $STAT_USR"
#################################################
###
USER_MKTMP_DIR=$(/usr/bin/mktemp -d)
USR_TMP_DIR_T=$(/usr/bin/dirname "$USER_MKTMP_DIR")
USR_TMP_DIR=$(/usr/bin/dirname "$USR_TMP_DIR_T")
###
STR_GO2_TRASH_DIR="$USR_TMP_DIR""/T/us.zoom.xos"
/bin/mkdir -p "$STR_GO2_TRASH_DIR"
USER_TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/ZOOM.XXXXXXXX")
/bin/mv "$STR_GO2_TRASH_DIR" "$USER_TRASH_DIR"
###
STR_GO2_TRASH_DIR="$USR_TMP_DIR""/C/us.zoom.xos"
/bin/mkdir -p "$STR_GO2_TRASH_DIR"
USER_TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/ZOOM.XXXXXXXX")
/bin/mv "$STR_GO2_TRASH_DIR" "$USER_TRASH_DIR"

#################################################
###
STR_GO2_TRASH_DIR="/Applications/ZoomOutlookPlugin"
/bin/mkdir -p "$STR_GO2_TRASH_DIR"
USER_TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/ZOOM.XXXXXXXX")
/bin/mv "$STR_GO2_TRASH_DIR" "$USER_TRASH_DIR"
###
STR_GO2_TRASH_DIR="$HOME/Library/Caches/us.zoom.xos"
/bin/mkdir -p "$STR_GO2_TRASH_DIR"
USER_TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/ZOOM.XXXXXXXX")
/bin/mv "$STR_GO2_TRASH_DIR" "$USER_TRASH_DIR"
###
STR_GO2_TRASH_DIR="$HOME/Library/Application Scripts/BJ4HAAB9B3.ZoomClient3rd"
/bin/mkdir -p "$STR_GO2_TRASH_DIR"
USER_TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/ZOOM.XXXXXXXX")
/bin/mv "$STR_GO2_TRASH_DIR" "$USER_TRASH_DIR"
###
STR_GO2_TRASH_DIR="$HOME/Library/WebKit/us.zoom.xos"
/bin/mkdir -p "$STR_GO2_TRASH_DIR"
USER_TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/ZOOM.XXXXXXXX")
/bin/mv "$STR_GO2_TRASH_DIR" "$USER_TRASH_DIR"
###
STR_GO2_TRASH_DIR="$HOME//Library/Logs/zoom.us"
/bin/mkdir -p "$STR_GO2_TRASH_DIR"
USER_TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/ZOOM.XXXXXXXX")
/bin/mv "$STR_GO2_TRASH_DIR" "$USER_TRASH_DIR"
###
STR_GO2_TRASH_DIR="$HOME/Library/Logs/ZoomPhone"
/bin/mkdir -p "$STR_GO2_TRASH_DIR"
USER_TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/ZOOM.XXXXXXXX")
/bin/mv "$STR_GO2_TRASH_DIR" "$USER_TRASH_DIR"
###
STR_GO2_TRASH_DIR="$HOME/Library/HTTPStorages/us.zoom.xos"
/bin/mkdir -p "$STR_GO2_TRASH_DIR"
USER_TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/ZOOM.XXXXXXXX")
/bin/mv "$STR_GO2_TRASH_DIR" "$USER_TRASH_DIR"
###
STR_GO2_TRASH_DIR="$HOME/Library/Group Containers/BJ4HAAB9B3.ZoomClient3rd"
/bin/mkdir -p "$STR_GO2_TRASH_DIR"
USER_TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/ZOOM.XXXXXXXX")
/bin/mv "$STR_GO2_TRASH_DIR" "$USER_TRASH_DIR"
###
STR_GO2_TRASH_DIR="$HOME/Library/Application Support/zoom.us/data/WaitingRoom"
/bin/mkdir -p "$STR_GO2_TRASH_DIR"
USER_TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/ZOOM.XXXXXXXX")
/bin/mv "$STR_GO2_TRASH_DIR" "$USER_TRASH_DIR"
###
STR_GO2_TRASH_DIR="$HOME/Library/Application Support/zoom.us/data/VideoClips"
/bin/mkdir -p "$STR_GO2_TRASH_DIR"
USER_TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/ZOOM.XXXXXXXX")
/bin/mv "$STR_GO2_TRASH_DIR" "$USER_TRASH_DIR"

###############
STR_GO2_TRASH_DIR="$HOME/Library/Receipts/ZoomMacOutlookPlugin.pkg.plist"
/usr/bin/touch "$STR_GO2_TRASH_DIR"
USER_TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/ZOOM.XXXXXXXX")
/bin/mv "$STR_GO2_TRASH_DIR" "$USER_TRASH_DIR"
###
STR_GO2_TRASH_DIR="$HOME/Library/Receipts/ZoomMacOutlookPlugin.pkg.bom"
/usr/bin/touch "$STR_GO2_TRASH_DIR"
USER_TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/ZOOM.XXXXXXXX")
/bin/mv "$STR_GO2_TRASH_DIR" "$USER_TRASH_DIR"
###
STR_GO2_TRASH_DIR="$HOME/Library/Receipts/us.zoom.pkg.videomeeting.bom"
/usr/bin/touch "$STR_GO2_TRASH_DIR"
USER_TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/ZOOM.XXXXXXXX")
/bin/mv "$STR_GO2_TRASH_DIR" "$USER_TRASH_DIR"
###
STR_GO2_TRASH_DIR="$HOME/Library/Receipts/us.zoom.pkg.videomeeting.plist"
/usr/bin/touch "$STR_GO2_TRASH_DIR"
USER_TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/ZOOM.XXXXXXXX")
/bin/mv "$STR_GO2_TRASH_DIR" "$USER_TRASH_DIR"
###
STR_GO2_TRASH_DIR="$HOME/Library/Logs/zoomusinstall.log"
/usr/bin/touch "$STR_GO2_TRASH_DIR"
USER_TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/ZOOM.XXXXXXXX")
/bin/mv "$STR_GO2_TRASH_DIR" "$USER_TRASH_DIR"
###
STR_GO2_TRASH_DIR="$HOME/Library/HTTPStorages/us.zoom.xos.binarycookies"
/usr/bin/touch "$STR_GO2_TRASH_DIR"
USER_TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/ZOOM.XXXXXXXX")
/bin/mv "$STR_GO2_TRASH_DIR" "$USER_TRASH_DIR"
###
STR_GO2_TRASH_DIR="$HOME/Library/Application Support/zoom.us/data/zoomus.enc.db.malformed"
/usr/bin/touch "$STR_GO2_TRASH_DIR"
USER_TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/ZOOM.XXXXXXXX")
/bin/mv "$STR_GO2_TRASH_DIR" "$USER_TRASH_DIR"
###
STR_GO2_TRASH_DIR="$HOME/Library/Application Support/zoom.us/data/meetingpaaplog.bin"
/usr/bin/touch "$STR_GO2_TRASH_DIR"
USER_TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/ZOOM.XXXXXXXX")
/bin/mv "$STR_GO2_TRASH_DIR" "$USER_TRASH_DIR"
###
STR_GO2_TRASH_DIR="$HOME/Library/Application Support/zoom.us/data/ptpaaplog.bin"
/usr/bin/touch "$STR_GO2_TRASH_DIR"
USER_TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/ZOOM.XXXXXXXX")
/bin/mv "$STR_GO2_TRASH_DIR" "$USER_TRASH_DIR"
###
STR_GO2_TRASH_DIR="$HOME/Library/Application Support/zoom.us/data/zmonitorlog.bin"
/usr/bin/touch "$STR_GO2_TRASH_DIR"
USER_TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/ZOOM.XXXXXXXX")
/bin/mv "$STR_GO2_TRASH_DIR" "$USER_TRASH_DIR"

#####
#
/usr/bin/touch "$HOME/Library/Application Support/zoom.us/ZoomClips.app"

/bin/rm "$HOME/Library/Application Support/zoom.us/ZoomClips.app"

/bin/ln -s "$HOME/Library/Application Support/zoom.us/Plugins/Frameworks/ZoomClips.app" "$HOME/Library/Application Support/zoom.us/ZoomClips.app"

/bin/echo "Done"
exit 0


|

[bash]Zoomアップデート 少し修正


【スクリプトエディタで開く】|

#!/bin/bash
#com.cocolog-nifty.quicktimer.icefloe
#ユーザードメインにインストール
########################################
##実行パス
SCRIPT_PATH="${BASH_SOURCE[0]}"
/bin/echo "実行中のスクリプト"
/bin/echo "\"$SCRIPT_PATH\""


########################################
##事前チェック

CHK_APP_PATH="/Applications/zoom.us.app"
if [ -e "$CHK_APP_PATH" ]; then
  /bin/echo "【エラー】$CHK_APP_PATHが存在します以下のコマンドをターミナルで実行してください"
  /bin/echo "/usr/bin/sudo /bin/mv \"$CHK_APP_PATH\" \"$HOME/.Trash\""
  exit 1
fi
CHK_APP_PATH="/Applications/ZoomOutlookPlugin"
if [ -e "$CHK_APP_PATH" ]; then
TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/ZOOM.XXXXXXXX")
/bin/chmod 777 "$TRASH_DIR"
/bin/mv "$CHK_APP_PATH" "$TRASH_DIR"
fi
if [ -e "$CHK_APP_PATH" ]; then
  /bin/echo "【エラー】$CHK_APP_PATHが存在します以下のコマンドをターミナルで実行してください"
  /bin/echo "/usr/bin/sudo /bin/mv \"$CHK_APP_PATH\" \"$HOME/.Trash\""
  exit 1
fi
CHK_APP_PATH="/Library/Application Support/zoom.us"
if [ -e "$CHK_APP_PATH" ]; then
  /bin/echo "【エラー】$CHK_APP_PATHが存在します以下のコマンドをターミナルで実行してください"
  /bin/echo "/usr/bin/sudo /bin/mv \"$CHK_APP_PATH\" \"$HOME/.Trash\""
  exit 1
fi

CHK_APP_PATH="/Library/PrivilegedHelperTools/us.zoom.ZoomDaemon"
if [ -e "$CHK_APP_PATH" ]; then
  /bin/echo "【エラー】$CHK_APP_PATHが存在します以下のコマンドをターミナルで実行してください"
  /bin/echo "/usr/bin/sudo /bin/mv \"$CHK_APP_PATH\" \"$HOME/.Trash\""
  exit 1
fi
CHK_APP_PATH="/Library/LaunchDaemons/us.zoom.ZoomDaemon.plist"
if [ -e "$CHK_APP_PATH" ]; then
  /bin/echo "【エラー】$CHK_APP_PATHが存在します以下のコマンドをターミナルで実行してください"
  /bin/echo "/usr/bin/sudo /bin/mv \"$CHK_APP_PATH\" \"$HOME/.Trash\""
  exit 1
fi

########################################
##OS
PLIST_PATH="/System/Library/CoreServices/SystemVersion.plist"
STR_OS_VER=$(/usr/bin/defaults read "$PLIST_PATH" ProductVersion)
/bin/echo "OS VERSION :" "$STR_OS_VER"
STR_MAJOR_VERSION="${STR_OS_VER%%.*}"
/bin/echo "STR_MAJOR_VERSION :" "$STR_MAJOR_VERSION"
STR_MINOR_VERSION="${STR_OS_VER#*.}"
/bin/echo "STR_MINOR_VERSION :" "$STR_MINOR_VERSION"
# STR_MAJOR_VERSION=$(/usr/bin/sw_vers -productVersion | /usr/bin/cut -d '.' -f 1,1)
# STR_MINOR_VERSION=$(/usr/bin/sw_vers -productVersion | /usr/bin/cut -d '.' -f 2,2)

########################################
##ユーザー
USER_WHOAMI=$(/usr/bin/whoami)
/bin/echo "実行したユーザーは:$USER_WHOAMI"
CURRENT_USER=$(/bin/echo "$HOME" | /usr/bin/awk -F'/' '{print $NF}')
/bin/echo "実行中ユーザー:" "$CURRENT_USER"

########################################
###ダウンロード起動時に削除する項目
USER_TEMP_DIR=$(/usr/bin/mktemp -d)
/bin/echo "起動時に削除されるディレクトリ:" "$USER_TEMP_DIR"

########################################
##デバイス
#起動ディスクの名前を取得する
/usr/bin/touch "$USER_TEMP_DIR/diskutil.plist"
/usr/sbin/diskutil info -plist / >"$USER_TEMP_DIR/diskutil.plist"
STARTUPDISK_NAME=$(/usr/bin/defaults read "$USER_TEMP_DIR/diskutil.plist" VolumeName)
/bin/echo "ボリューム名:" "$STARTUPDISK_NAME"
STR_DEVICE_UUID=$(/usr/sbin/ioreg -c IOPlatformExpertDevice | grep IOPlatformUUID | awk -F'"' '{print $4}')
/bin/echo "デバイスUUID: " "$STR_DEVICE_UUID"
############################################################
##基本メンテナンス
##ライブラリの不可視属性を解除
/usr/bin/chflags nohidden "/Users/$CURRENT_USER/Library"
/usr/bin/SetFile -a v "/Users/$CURRENT_USER/Library"
## Managed Itemsフォルダを作る
/bin/mkdir -p "/Users/$CURRENT_USER/Library/Managed Items"
/bin/chmod 755 "/Users/$CURRENT_USER/Library/Managed Items"
/usr/sbin/chown "$CURRENT_USER" "/Users/$CURRENT_USER/Library/Managed Items"
/usr/bin/touch "/Users/$CURRENT_USER/Library/Managed Items/.localized"

########################################
## HOME
########################################
## Developer
STR_CHECK_DIR_PATH="/Users/$CURRENT_USER/Developer"
/bin/mkdir -p "$STR_CHECK_DIR_PATH"
/bin/chmod 700 "$STR_CHECK_DIR_PATH"
/usr/bin/touch "$STR_CHECK_DIR_PATH/.localized"
## bin
STR_CHECK_DIR_PATH="/Users/$CURRENT_USER/bin"
/bin/mkdir -p "$STR_CHECK_DIR_PATH"
/bin/chmod 700 "$STR_CHECK_DIR_PATH"
##アクセス権チェック
/bin/chmod 700 "/Users/$CURRENT_USER/Library"
/bin/chmod 700 "/Users/$CURRENT_USER/Movies"
/bin/chmod 700 /"Users/$CURRENT_USER/Music"
/bin/chmod 700 "/Users/$CURRENT_USER/Pictures"
/bin/chmod 700 "/Users/$CURRENT_USER/Downloads"
/bin/chmod 700 "/Users/$CURRENT_USER/Documents"
/bin/chmod 700 "/Users/$CURRENT_USER/Desktop"
##全ローカルユーザーに対して実施したい処理があれば追加する
/bin/echo "ユーザーディレクトリチェックDONE"
########################################
## Public
########################################
/bin/chmod 755 "/Users/$CURRENT_USER/Public"
##
STR_CHECK_DIR_PATH="/Users/$CURRENT_USER/Public/Drop Box"
/bin/mkdir -p "$STR_CHECK_DIR_PATH"
/bin/chmod 733 "$STR_CHECK_DIR_PATH"
/usr/bin/touch "$STR_CHECK_DIR_PATH/.localized"
/usr/bin/chgrp -Rf nobody "$STR_CHECK_DIR_PATH"
##########
STR_CHECK_DIR_PATH="/Users/$CURRENT_USER/Public/Documents"
/bin/mkdir -p "$STR_CHECK_DIR_PATH"
/bin/chmod 700 "$STR_CHECK_DIR_PATH"
/usr/bin/touch "$STR_CHECK_DIR_PATH/.localized"
/usr/bin/chgrp -Rf admin "$STR_CHECK_DIR_PATH"
##
STR_CHECK_DIR_PATH="/Users/$CURRENT_USER/Public/Downloads"
/bin/mkdir -p "$STR_CHECK_DIR_PATH"
/bin/chmod 700 "$STR_CHECK_DIR_PATH"
/usr/bin/touch "$STR_CHECK_DIR_PATH/.localized"
/usr/bin/chgrp -Rf admin "$STR_CHECK_DIR_PATH"
##
STR_CHECK_DIR_PATH="/Users/$CURRENT_USER/Public/Favorites"
/bin/mkdir -p "$STR_CHECK_DIR_PATH"
/bin/chmod 700 "$STR_CHECK_DIR_PATH"
/usr/bin/touch "$STR_CHECK_DIR_PATH/.localized"
/usr/bin/chgrp -Rf admin "$STR_CHECK_DIR_PATH"
##########
STR_CHECK_DIR_PATH="/Users/$CURRENT_USER/Public/Groups"
/bin/mkdir -p "$STR_CHECK_DIR_PATH"
/bin/chmod 770 "$STR_CHECK_DIR_PATH"
/usr/bin/touch "$STR_CHECK_DIR_PATH/.localized"
/usr/bin/chgrp -Rf staff "$STR_CHECK_DIR_PATH"
##
STR_CHECK_DIR_PATH="/Users/$CURRENT_USER/Public/Shared"
/bin/mkdir -p "$STR_CHECK_DIR_PATH"
/bin/chmod 750 "$STR_CHECK_DIR_PATH"
/usr/bin/touch "$STR_CHECK_DIR_PATH/.localized"
/usr/bin/chgrp -Rf staff "$STR_CHECK_DIR_PATH"
##########
STR_CHECK_DIR_PATH="/Users/$CURRENT_USER/Public/Guest"
/bin/mkdir -p "$STR_CHECK_DIR_PATH"
/bin/chmod 777 "$STR_CHECK_DIR_PATH"
/usr/bin/touch "$STR_CHECK_DIR_PATH/.localized"
/usr/bin/chgrp -Rf nobody "$STR_CHECK_DIR_PATH"
##
STR_CHECK_DIR_PATH="/Users/$CURRENT_USER/Public/Shared Items"
/bin/mkdir -p "$STR_CHECK_DIR_PATH"
/bin/chmod 775 "$STR_CHECK_DIR_PATH"
/usr/bin/touch "$STR_CHECK_DIR_PATH/.localized"
/usr/bin/chgrp -Rf nobody "$STR_CHECK_DIR_PATH"

########################################
## Applications
########################################
## Applications
STR_CHECK_DIR_PATH="/Users/$CURRENT_USER/Applications"
/bin/mkdir -p "$STR_CHECK_DIR_PATH"
/bin/chmod 700 "$STR_CHECK_DIR_PATH"
/usr/bin/touch "$STR_CHECK_DIR_PATH/.localized"
##サブフォルダを作る
LIST_SUB_DIR_NAME=("Demos" "Desktop" "Developer" "Documents" "Downloads" "Favorites" "Groups" "Library" "Movies" "Music" "Pictures" "Public" "Shared" "Sites" "System" "Users" "Utilities")
##リストの数だけ処理
for ITEM_DIR_NAME in "${LIST_SUB_DIR_NAME[@]}"; do
  /bin/mkdir -p "$STR_CHECK_DIR_PATH/${ITEM_DIR_NAME}"
  /bin/chmod 700 "$STR_CHECK_DIR_PATH/${ITEM_DIR_NAME}"
  /usr/bin/touch "$STR_CHECK_DIR_PATH/${ITEM_DIR_NAME}/.localized"
done
########################################
##シンボリックリンクを作る
if [[ ! -e "/Users/$CURRENT_USER/Applications/Applications" ]]; then
  /bin/ln -s "/Applications" "/Users/$CURRENT_USER/Applications/Applications"
fi
if [[ ! -e "/Users/$CURRENT_USER/Applications/Utilities/Finder Applications" ]]; then
  /bin/ln -s "/System/Library/CoreServices/Finder.app/Contents/Applications" "/Users/$CURRENT_USER/Applications/Utilities/Finder Applications"
fi
if [[ ! -e "/Users/$CURRENT_USER/Applications/Utilities/Finder Libraries" ]]; then
  /bin/ln -s "/System/Library/CoreServices/Finder.app/Contents/Resources/MyLibraries" "/Users/$CURRENT_USER/Applications/Utilities/Finder Libraries"
fi
if [[ ! -e "/Users/$CURRENT_USER/Applications/Utilities/System Applications" ]]; then
  /bin/ln -s "/System/Library/CoreServices/Applications" "/Users/$CURRENT_USER/Applications/Utilities/System Applications"
fi
if [[ ! -e "/Users/$CURRENT_USER/Applications/Utilities/System Utilities" ]]; then
  /bin/ln -s "/Applications/Utilities" "/Users/$CURRENT_USER/Applications/Utilities/System Utilities"
fi


##全ローカルユーザーに対して実施したい処理があれば追加する
/bin/echo "ユーザーディレクトリチェックDONE"
################################################
###設定項目
STR_BUNDLEID="us.zoom.xos"
STR_APP_PATH="$HOME/Applications/zoom.us.app"
###アプリケーション名を取得
STR_APP_NAME=$(/usr/bin/defaults read "$STR_APP_PATH/Contents/Info.plist" CFBundleDisplayName)
if [ -z "$STR_APP_NAME" ]; then
  STR_APP_NAME=$(/usr/bin/defaults read "$STR_APP_PATH/Contents/Info.plist" CFBundleName)
fi
/bin/echo "アプリケーション名:$STR_APP_NAME"
#######################################
### DOCKに登録済みかゴミ箱に入れる前に調べておく
## Dockの登録数を調べる
JSON_PERSISENT_APPS=$(/usr/bin/defaults read com.apple.dock persistent-apps)
NUN_CNT_ITEM=$(/bin/echo "$JSON_PERSISENT_APPS" | grep -o "tile-data" | wc -l)
/bin/echo "Dock登録数:$NUN_CNT_ITEM"
##Dockの登録数だけ繰り返し
NUM_CNT=0 #カウンタ初期化
NUM_POSITION="NULL" #ポジション番号にNULL文字を入れる
###対象のバンドルIDがDockに登録されているか順番に調べる
while [ $NUM_CNT -lt "$NUN_CNT_ITEM" ]; do
  ##順番にバンドルIDを取得して
  STR_CHK_BUNDLEID=$(/usr/libexec/PlistBuddy -c "Print:persistent-apps:$NUM_CNT:tile-data:bundle-identifier" "$HOME/Library/Preferences/com.apple.dock.plist")
  ##対象のバンドルIDだったら
  if [ "$STR_CHK_BUNDLEID" = "$STR_BUNDLEID" ]; then
    /bin/echo "DockのポジションNO: $NUM_CNT バンドルID:$STR_CHK_BUNDLEID"
    ##位置情報ポジションを記憶しておく
    NUM_POSITION=$NUM_CNT
  fi
  NUM_CNT=$((NUM_CNT + 1))
done

#######################################
## 本処理 ダウンロードディレクトリ
DOWNLOADS_DIR_PATH=$(/usr/bin/mktemp -d)
/bin/chmod 777 "$DOWNLOADS_DIR_PATH"
/bin/echo "ダウンロードディレクトリ:" "$DOWNLOADS_DIR_PATH"
#######################################
##プロセス終了
/usr/bin/killall "zoom.us" 2>/dev/null
/usr/bin/killall "caphost" 2>/dev/null

#######################################
##古いファイルをゴミ箱に USER
function DO_MOVE_TO_TRASH() {
  if [ -e "$1" ]; then
    TRASH_DIR=$(/usr/bin/mktemp -d "/Users/$CURRENT_USER/.Trash/ZOOM.XXXXXXXX")
    /bin/chmod 777 "$TRASH_DIR"
    /bin/mv "$1" "$TRASH_DIR"
  fi
}
DO_MOVE_TO_TRASH "/Users/$CURRENT_USER/Applications/zoom.us.app"
DO_MOVE_TO_TRASH "/Users/$CURRENT_USER/Applications/ZoomOutlookPlugin"

DO_MOVE_TO_TRASH "/Users/$CURRENT_USER/Applications/Groups/zoom.us.app"
DO_MOVE_TO_TRASH "/Users/$CURRENT_USER/Applications/Groups/ZoomOutlookPlugin"

DO_MOVE_TO_TRASH "/Users/$CURRENT_USER/Library/Caches/us.zoom.xos"
DO_MOVE_TO_TRASH "/Users/$CURRENT_USER/Library/WebKit/us.zoom.xos"
DO_MOVE_TO_TRASH "/Users/$CURRENT_USER/Library/Saved Application State/us.zoom.xos.savedState"
DO_MOVE_TO_TRASH "/Users/$CURRENT_USER/Library/Receipts/ZoomMacOutlookPlugin.pkg.plist"
DO_MOVE_TO_TRASH "/Users/$CURRENT_USER/Library/Receipts/ZoomMacOutlookPlugin.pkg.bom"
DO_MOVE_TO_TRASH "/Users/$CURRENT_USER/Library/Logs/ZoomPhone"
DO_MOVE_TO_TRASH "/Users/$CURRENT_USER/Library/Logs/zoom.us"
DO_MOVE_TO_TRASH "/Users/$CURRENT_USER/Library/HTTPStorages/us.zoom.xos.binarycookies"
DO_MOVE_TO_TRASH "/Users/$CURRENT_USER/Library/HTTPStorages/us.zoom.xos"

#######################################
## 本処理 ダウンロード
ARCHITEC=$(/usr/bin/arch)
/bin/echo "Running on $ARCHITEC"
if [ "$ARCHITEC" == "arm64" ]; then

  STR_URL="https://zoom.us/client/latest/ZoomMacOutlookPlugin.pkg?archType=arm64"
  ###ファイル名を取得
  PKG_FILE_NAME=$(/usr/bin/curl -s -L -I -o /dev/null -w '%{url_effective}' "$STR_URL" | /usr/bin/rev | /usr/bin/cut -d'/' -f1 | /usr/bin/rev)
  /bin/echo "PKG_FILE_NAME" "$PKG_FILE_NAME"
  if ! /usr/bin/curl -L -o "$DOWNLOADS_DIR_PATH/$PKG_FILE_NAME" "$STR_URL" --connect-timeout 20; then
    /bin/echo "ファイルのダウンロードに失敗しました HTTP1.1をトライします"
    /usr/bin/curl -L -o "$DOWNLOADS_DIR_PATH/$PKG_FILE_NAME" "$STR_URL" --http1.1 --connect-timeout 20
  fi
  /usr/bin/killall "zoom.us" 2>/dev/null
  /usr/bin/killall "caphost" 2>/dev/null
  ###本処理 インストール
  /usr/sbin/installer -pkg "$DOWNLOADS_DIR_PATH/$PKG_FILE_NAME" -target CurrentUserHomeDirectory -dumplog -allowUntrusted -lang ja

  #######################################
  STR_URL="https://zoom.us/client/latest/Zoom.pkg?archType=arm64"
  ###ファイル名を取得
  PKG_FILE_NAME=$(/usr/bin/curl -s -L -I -o /dev/null -w '%{url_effective}' "$STR_URL" | /usr/bin/rev | /usr/bin/cut -d'/' -f1 | /usr/bin/rev)
  /bin/echo "PKG_FILE_NAME" "$PKG_FILE_NAME"
  if ! /usr/bin/curl -L -o "$DOWNLOADS_DIR_PATH/$PKG_FILE_NAME" "$STR_URL" --connect-timeout 20; then
    /bin/echo "ファイルのダウンロードに失敗しました HTTP1.1をトライします"
    /usr/bin/curl -L -o "$DOWNLOADS_DIR_PATH/$PKG_FILE_NAME" "$STR_URL" --http1.1 --connect-timeout 20
  fi
  /usr/bin/killall "zoom.us" 2>/dev/null
  /usr/bin/killall "caphost" 2>/dev/null
  ###本処理 インストール
  /usr/sbin/installer -pkg "$DOWNLOADS_DIR_PATH/$PKG_FILE_NAME" -target CurrentUserHomeDirectory -dumplog -allowUntrusted -lang ja

else

  #######################################
  STR_URL="https://zoom.us/client/latest/ZoomMacOutlookPlugin.pkg?archType=x86"
  ###ファイル名を取得
  PKG_FILE_NAME=$(/usr/bin/curl -s -L -I -o /dev/null -w '%{url_effective}' "$STR_URL" | /usr/bin/rev | /usr/bin/cut -d'/' -f1 | /usr/bin/rev)
  /bin/echo "PKG_FILE_NAME" "$PKG_FILE_NAME"
  if ! /usr/bin/curl -L -o "$DOWNLOADS_DIR_PATH/$PKG_FILE_NAME" "$STR_URL" --connect-timeout 20; then
    /bin/echo "ファイルのダウンロードに失敗しました HTTP1.1をトライします"
    /usr/bin/curl -L -o "$DOWNLOADS_DIR_PATH/$PKG_FILE_NAME" "$STR_URL" --http1.1 --connect-timeout 20
  fi
  /usr/bin/killall "zoom.us" 2>/dev/null
  /usr/bin/killall "caphost" 2>/dev/null
  ###本処理 インストール
  /usr/sbin/installer -pkg "$DOWNLOADS_DIR_PATH/$PKG_FILE_NAME" -target CurrentUserHomeDirectory -dumplog -allowUntrusted -lang ja

  #######################################
  STR_URL="https://zoom.us/client/latest/Zoom.pkg?archType=x86"
  ###ファイル名を取得
  PKG_FILE_NAME=$(/usr/bin/curl -s -L -I -o /dev/null -w '%{url_effective}' "$STR_URL" | /usr/bin/rev | /usr/bin/cut -d'/' -f1 | /usr/bin/rev)
  /bin/echo "PKG_FILE_NAME" "$PKG_FILE_NAME"
  if ! /usr/bin/curl -L -o "$DOWNLOADS_DIR_PATH/$PKG_FILE_NAME" "$STR_URL" --connect-timeout 20; then
    /bin/echo "ファイルのダウンロードに失敗しました HTTP1.1をトライします"
    /usr/bin/curl -L -o "$DOWNLOADS_DIR_PATH/$PKG_FILE_NAME" "$STR_URL" --http1.1 --connect-timeout 20
  fi
  /usr/bin/killall "zoom.us" 2>/dev/null
  /usr/bin/killall "caphost" 2>/dev/null
  ###本処理 インストール
  /usr/sbin/installer -pkg "$DOWNLOADS_DIR_PATH/$PKG_FILE_NAME" -target CurrentUserHomeDirectory -dumplog -allowUntrusted -lang ja

fi


#######################################
##結果 対象のバンドルIDが無ければ
  /bin/echo "DockのポジションNO: $NUM_POSITION"
if [ "$NUM_POSITION" = "NULL" ]; then
  /bin/echo "Dockに未登録です"
  PLIST_DICT="<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>$STR_APP_PATH</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>"
  /usr/bin/defaults write com.apple.dock persistent-apps -array-add "$PLIST_DICT"
else
  ##すでに登録済みの場合は一旦削除
  /bin/echo "Dockの$NUM_POSITION に登録済み 削除してから同じ場所に登録しなおします"
  ##削除して
##/usr/libexec/PlistBuddy -c "Delete:persistent-apps:$NUM_POSITION" "$HOME/Library/Preferences/com.apple.dock.plist"
  ##保存
##/usr/libexec/PlistBuddy -c "Save" "$HOME/Library/Preferences/com.apple.dock.plist"
  ###同じ内容を作成する
##/usr/libexec/PlistBuddy -c "Revert" "$HOME/Library/Preferences/com.apple.dock.plist"
  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION dict" "$HOME/Library/Preferences/com.apple.dock.plist"
  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION:GUID integer $RANDOM$RANDOM" "$HOME/Library/Preferences/com.apple.dock.plist"
  ## 想定値 file-tile directory-tile
  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION:tile-type string file-tile" "$HOME/Library/Preferences/com.apple.dock.plist"
  ###↑この親Dictに子要素としてtile-dataをDictで追加
  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION:tile-data dict" "$HOME/Library/Preferences/com.apple.dock.plist"
  ###↑子要素のtile-dataにキーと値を入れていく
  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION:tile-data:showas integer 0" "$HOME/Library/Preferences/com.apple.dock.plist"
  ## 想定値 2:フォルダ 41:アプリケーション 169 Launchpad とMission Control
  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION:tile-data:file-type integer 41" "$HOME/Library/Preferences/com.apple.dock.plist"
  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION:tile-data:displayas integer 0" "$HOME/Library/Preferences/com.apple.dock.plist"
  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION:tile-data:parent-mod-date integer $(date '+%s')" "$HOME/Library/Preferences/com.apple.dock.plist"
  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION:tile-data:file-mod-date integer $(date '+%s')" "$HOME/Library/Preferences/com.apple.dock.plist"
  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION:tile-data:file-label string $STR_APP_NAME" "$HOME/Library/Preferences/com.apple.dock.plist"
  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION:tile-data:is-beta bool false" "$HOME/Library/Preferences/com.apple.dock.plist"
  ###↑この子要素のtile-dataに孫要素でfile-dataをDictで追加
  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION:tile-data:file-data dict" "$HOME/Library/Preferences/com.apple.dock.plist"
  ###値を入れていく
  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION:tile-data:file-data:_CFURLStringType integer 15" "$HOME/Library/Preferences/com.apple.dock.plist"
  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION:tile-data:file-data:_CFURLString string file://$STR_APP_PATH" "$HOME/Library/Preferences/com.apple.dock.plist"
  ##保存
  /usr/libexec/PlistBuddy -c "Save" "$HOME/Library/Preferences/com.apple.dock.plist"
fi
/usr/bin/killall "cfprefsd"

sleep 1
###
/bin/echo "処理終了 DOCKを再起動します"
/usr/bin/killall "Dock"

exit 0


|

pkgインストール(ユーザー権限)

だいぶ改良した

【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
# セルフインストールのサンプル zoom
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application


##################################
##【1】CPUタイプのよる処理の分岐
set recordSysInfo to system info
set strCpuType to (CPU type of recordSysInfo) as text
if strCpuType contains "Intel" then
  set strPkgURL to "https://zoom.us/client/latest/Zoom.pkg?archType=arm64" as text
  log strCpuType
else if strCpuType contains "ARM" then
  set strPkgURL to "https://zoom.us/client/latest/Zoom.pkg?archType=arm64" as text
  log strCpuType
else
return "不明なCUP処理終了"
end if

##################################
##【2】ダウンロード 
##起動時に削除する項目
set appFileManager to refMe's NSFileManager's defaultManager()
set ocidTempDirURL to appFileManager's temporaryDirectory()
##フォルダ名はUUIDを使う
set ocidConcreteUUID to refMe's NSUUID's UUID()
set ocidUUIDString to ocidConcreteUUID's UUIDString()
set ocidTempDirPathURL to ocidTempDirURL's URLByAppendingPathComponent:(ocidUUIDString) isDirectory:true
##フォルダを777アクセス権で作成
set ocidAttrDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
ocidAttrDict's setValue:(511) forKey:(refMe's NSFilePosixPermissions)
set boolDone to appFileManager's createDirectoryAtURL:(ocidTempDirPathURL) withIntermediateDirectories:(true) attributes:(ocidAttrDict) |error|:(reference)
log boolDone
set strTempDirPath to (ocidTempDirPathURL's |path|()) as text
##ファイル名を取得
try
  set strCommandText to ("/usr/bin/curl -s -L -I -o /dev/null -w '%{url_effective}' \"" & strPkgURL & "\" | /usr/bin/rev | /usr/bin/cut -d'/' -f1 | /usr/bin/rev") as text
  set strSaveFileName to (do shell script strCommandText) as text
on error
  try
    set strCommandText to ("/usr/bin/curl -s -L -I -o /dev/null -w '%{url_effective}' \"" & strPkgURL & "\" --http1.1 --connect-timeout 20 | /usr/bin/rev | /usr/bin/cut -d'/' -f1 | /usr/bin/rev") as text
    set strSaveFileName to (do shell script strCommandText) as text
  on error
    set strSaveFileName to "install.pkg"
  end try
end try
##ダウンロード
try
  set strCommandText to "/usr/bin/curl -L -o \"" & strTempDirPath & "/" & strSaveFileName & "\"  \"" & strPkgURL & "\" --connect-timeout 20" as text
  do shell script strCommandText
on error
  try
    set strCommandText to "/usr/bin/curl -L -o \"" & strTempDirPath & "/" & strSaveFileName & "\"  \"" & strPkgURL & "\" --http1.1 --connect-timeout 20" as text
    do shell script strCommandText
  on error
return "インストーラーのダウンロードに失敗しました"
  end try
end try


##################################
##【3】インストール前準備
###Dockのポジションを記憶 "/Library/Managed Preferences" は考慮しない
set strFilePath to "~/Library/Preferences/com.apple.dock.plist" as text
set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath)
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
set ocidFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath) isDirectory:false)
set ocidPlistDict to refMe's NSMutableDictionary's alloc()'s initWithContentsOfURL:(ocidFilePathURL)
set ocidPerAppsArray to ocidPlistDict's objectForKey:("persistent-apps")
set intArrayNo to (count of ocidPerAppsArray) as integer
set intCntNo to 0 as integer
repeat with itemerAppsArray in ocidPerAppsArray
  set ocidTitleDataDict to (itemerAppsArray's objectForKey:("tile-data"))
  set ocidFileDataDict to (ocidTitleDataDict's objectForKey:("file-data"))
  set ocidCFURLString to (ocidFileDataDict's valueForKey:("_CFURLString"))
  if (ocidCFURLString as text) contains ("zoom.us.app") then
    exit repeat
  end if
  set intCntNo to intCntNo + 1 as integer
end repeat
if intArrayNo = intCntNo then
  set intDocNo to (intArrayNo) as integer
  log "Dockに登録されていません。一番下を指定します"
else
  set intDocNo to (intCntNo) as integer
  log "Dockの " & intCntNo & "番目に登録されています"
end if

###アプリケーション終了
set listUTI to {"us.zoom.caphost", "us.zoom.xos", "us.zoom.CptHost", "us.zoom.Transcode", "us.zoom.ZMScreenshot"} as list
###通常終了
repeat with itemUTI in listUTI
  ###NSRunningApplication
  set ocidRunningApplication to refMe's NSRunningApplication
  ###起動中のすべてのリスト
  set ocidAppArray to (ocidRunningApplication's runningApplicationsWithBundleIdentifier:(itemUTI))
  ###複数起動時も順番に終了
  repeat with itemAppArray in ocidAppArray
itemAppArray's terminate()
  end repeat
end repeat
delay 2
###強制終了
repeat with itemUTI in listUTI
  ###NSRunningApplication
  set ocidRunningApplication to refMe's NSRunningApplication
  ###起動中のすべてのリスト
  set ocidAppArray to (ocidRunningApplication's runningApplicationsWithBundleIdentifier:(itemUTI))
  ###複数起動時も順番に終了
  repeat with itemAppArray in ocidAppArray
itemAppArray's forceTerminate()
  end repeat
end repeat
###ユーザーアプリケーションディレクトリ700で
set ocidURLsPathArray to (appFileManager's URLsForDirectory:(refMe's NSApplicationDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidAppDirPathURL to ocidURLsPathArray's firstObject()
set ocidAttrDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
ocidAttrDict's setValue:(448) forKey:(refMe's NSFilePosixPermissions)
set boolDone to appFileManager's createDirectoryAtURL:(ocidAppDirPathURL) withIntermediateDirectories:(true) attributes:(ocidAttrDict) |error|:(reference)
###ローカライズファイル
set ocidLocalizedPathURL to ocidAppDirPathURL's URLByAppendingPathComponent:(".localized")
set ocidLocalizedPath to ocidLocalizedPathURL's |path|()
set boolDone to appFileManager's createFileAtPath:(ocidLocalizedPath) |contents|:(missing value) attributes:(ocidAttrDict)
###ゴミ箱
set ocidURLsPathArray to (appFileManager's URLsForDirectory:(refMe's NSTrashDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidTrashDirPathURL to ocidURLsPathArray's firstObject()

################################################
###クリーニング
################################################
to doGoToTrash(arg_strFilePath)
  set strFilePath to arg_strFilePath as text
  set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath)
  set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
  set ocidFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath))
  set appFileManager to refMe's NSFileManager's defaultManager()
  set boolDone to appFileManager's trashItemAtURL:(ocidFilePathURL) resultingItemURL:(ocidFilePathURL) |error|:(reference)
end doGoToTrash

doGoToTrash("/Applications/zoom.us.app")
doGoToTrash("/Applications/ZoomOutlookPlugin")
doGoToTrash("~/Applications/zoom.us.app")
delay 1 --> Dockからの削除待ち
doGoToTrash("~/Applications/ZoomOutlookPlugin")
doGoToTrash("~/Library/Caches/us.zoom.xos")
doGoToTrash("~/Library/WebKit/us.zoom.xos")
doGoToTrash("~/Library/Saved Application State/us.zoom.xos.savedState")
doGoToTrash("~/Library/Receipts/ZoomMacOutlookPlugin.pkg.plist")
doGoToTrash("~/Library/Receipts/ZoomMacOutlookPlugin.pkg.bom")
doGoToTrash("~/Library/Logs/ZoomPhone")
doGoToTrash("~/Library/Logs/zoom.us")
doGoToTrash("~/Library/HTTPStorages/us.zoom.xos.binarycookies")
doGoToTrash("~/Library/HTTPStorages/us.zoom.xos")

delay 1 --> Dockからの削除待ち

##################################
##【4】インストール本処理(ユーザーインストール)
###パッケージがあるか?確認
set strPkgPath to ("" & strTempDirPath & "/" & strSaveFileName & "") as text
set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath)
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
set boolFileExist to appFileManager's fileExistsAtPath:(ocidFilePath) isDirectory:(false)
if boolFileExist = true then
  set strCommandText to "/usr/sbin/installer -pkg \"" & strTempDirPath & "/" & strSaveFileName & "\" -target CurrentUserHomeDirectory -dumplog -allowUntrusted -lang ja" as text
  do shell script strCommandText
else
return "パッケージが見つかりません"
end if


##################################
##【5】後処理
##
###ユーザーインストールした場合のURL
set strAppPath to "~/Applications/zoom.us.app" as text
set ocidAppPathstr to refMe's NSString's stringWithString:(strAppPath)
set ocidAppPath to ocidAppPathstr's stringByStandardizingPath()
set ocidAppPathURL to refMe's NSURL's alloc()'s initFileURLWithPath:(ocidAppPath) isDirectory:true
set coidAbsoluteStringPath to ocidAppPathURL's absoluteString()

################################
###PLIST 読み込み
set strFilePath to "~/Library/Preferences/com.apple.dock.plist" as text
set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath)
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
set ocidPlistPathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath) isDirectory:false)
set ocidPlistDict to refMe's NSMutableDictionary's alloc()'s initWithContentsOfURL:(ocidPlistPathURL)
set ocidPersistentArray to ocidPlistDict's objectForKey:"persistent-apps"

################################
####persistent-appsデータ生成
set ocidAddDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
###GUID実際はランダム番号だがNSFileSystemFileNumberを使う
set listPathAttar to appFileManager's attributesOfItemAtPath:(ocidAppPath) |error|:(reference)
set ocidAttar to item 1 of listPathAttar
set numGUID to ocidAttar's valueForKey:(refMe's NSFileSystemFileNumber)
set ocidIntValue to (refMe's NSNumber's numberWithInteger:(numGUID))
ocidAddDict's setValue:(numGUID) forKey:("GUID")
###
set ocidStringValue to (refMe's NSString's stringWithString:("file-tile"))
ocidAddDict's setValue:(ocidStringValue) forKey:("tile-type")
################################
set ocidAddTitleDataDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
####dock-extra
set ocidBoolValue to (refMe's NSNumber's numberWithBool:false)
ocidAddTitleDataDict's setValue:(ocidBoolValue) forKey:("dock-extra")
####dock-extra
set ocidBoolValue to (refMe's NSNumber's numberWithBool:false)
ocidAddTitleDataDict's setValue:(ocidBoolValue) forKey:("is-beta")
####bundle-identifier
set ocidAppBundle to (refMe's NSBundle's bundleWithURL:(ocidAppPathURL))
set ocidBundleID to ocidAppBundle's bundleIdentifier
set ocidStringValue to ocidBundleID's UTF8String()
ocidAddTitleDataDict's setValue:(ocidStringValue) forKey:("bundle-identifier")
####file-label"
set listAttributesDict to ocidAppPathURL's resourceValuesForKeys:({refMe's NSURLLocalizedNameKey}) |error|:(reference)
set ocidAttributesDict to (item 1 of listAttributesDict)
set ocidLocalizedName to (ocidAttributesDict's objectForKey:(refMe's NSURLLocalizedNameKey))
set ocidFileLabel to (ocidLocalizedName's stringByDeletingPathExtension())
set ocidStringValue to ocidFileLabel's UTF8String()
ocidAddTitleDataDict's setValue:(ocidStringValue) forKey:("file-label")
####file-mod-date
set listAttributesDict to ocidAppPathURL's resourceValuesForKeys:({refMe's NSURLContentModificationDateKey}) |error|:(reference)
set ocidAttributesDict to (item 1 of listAttributesDict)
set ocidModificationDate to (ocidAttributesDict's objectForKey:(refMe's NSURLContentModificationDateKey))
set ocidModDate to ocidModificationDate's timeIntervalSince1970
set ocidIntValue to ocidModDate's intValue()
ocidAddTitleDataDict's setValue:(ocidIntValue) forKey:("file-mod-date")
####parent-mod-date
set ocidNow to refMe's NSDate's now
set ocidNowNo to ocidNow's timeIntervalSince1970
set ocidIntValue to ocidNowNo's intValue
ocidAddTitleDataDict's setValue:(ocidIntValue) forKey:("parent-mod-date")
####book
set listBookMarkData to (ocidAppPathURL's bookmarkDataWithOptions:(11) includingResourceValuesForKeys:({missing value}) relativeToURL:(missing value) |error|:(reference))
set ocidkDataValue to item 1 of listBookMarkData
(ocidAddTitleDataDict's setObject:(ocidkDataValue) forKey:("book"))
####file-type
# 169 Launchpad とMission Control
# 41 それ以外はまぁ41で間違いなさそう
set ocidIntValue to (refMe's NSNumber's numberWithInteger:41)
(ocidAddTitleDataDict's setValue:(ocidIntValue) forKey:("file-type"))
#########
set ocidAddFileDataDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
(ocidAddFileDataDict's setValue:(coidAbsoluteStringPath) forKey:("_CFURLString"))
####
# 0 /File/Path
# 15 file:// のURL形式
set ocidIntValue to (refMe's NSNumber's numberWithInteger:15)
(ocidAddFileDataDict's setValue:(ocidIntValue) forKey:("_CFURLStringType"))
#########
(ocidAddTitleDataDict's setObject:(ocidAddFileDataDict) forKey:("file-data"))
ocidAddDict's setObject:(ocidAddTitleDataDict) forKey:("tile-data")
####追加データを元のPLISTに戻す
ocidPersistentArray's insertObject:(ocidAddDict) atIndex:(intDocNo)
####保存
set boolDone to ocidPlistDict's writeToURL:(ocidPlistPathURL) atomically:true


###CFPreferencesを再起動
try
  set strCommandText to "/usr/bin/killall cfprefsd" as text
  do shell script strCommandText
on error
  set strPlistPath to "/System/Library/LaunchAgents/com.apple.cfprefsd.xpc.agent.plist"
  set strCommandText to ("/bin/launchctl stop -w \"" & strAgentPath & "\"")
  try
    do shell script strCommandText
  end try
  set strCommandText to ("/bin/launchctl start -w \"" & strAgentPath & "\"")
  try
    do shell script strCommandText
  end try
end try

########################
## Dock 再起動
########################

set strBundleID to "com.apple.dock"

########################
## 再起動
########################
set appSharedWorkspace to refMe's NSWorkspace's sharedWorkspace()
##バンドルからアプリケーションのURLを取得
set ocidAppBundle to (refMe's NSBundle's bundleWithIdentifier:(strBundleID))
if ocidAppBundle ≠ (missing value) then
  set ocidAppPathURL to ocidAppBundle's bundleURL()
else if ocidAppBundle = (missing value) then
  set ocidAppPathURL to (appSharedWorkspace's URLForApplicationWithBundleIdentifier:(strBundleID))
end if
##予備(アプリケーションのURL)
if ocidAppPathURL = (missing value) then
  tell application "Finder"
    try
      set aliasAppApth to (application file id strBundleID) as alias
      set strAppPath to POSIX path of aliasAppApth as text
      set strAppPathStr to refMe's NSString's stringWithString:(strAppPath)
      set strAppPath to strAppPathStr's stringByStandardizingPath()
      set ocidAppPathURL to refMe's NSURL's alloc()'s initFileURLWithPath:(strAppPath) isDirectory:true
    on error
return "アプリケーションが見つかりませんでした"
    end try
  end tell
end if
##Dock終了
set ocidRunningApplication to refMe's NSRunningApplication
###起動中のすべてのリスト
set ocidAppArray to (ocidRunningApplication's runningApplicationsWithBundleIdentifier:(strBundleID))
###複数起動時も順番に終了
repeat with itemAppArray in ocidAppArray
  ###終了
itemAppArray's terminate()
end repeat
##1秒まって終了を確認
delay 1
##終了できない場合は強制終了
repeat with itemAppArray in ocidAppArray
  set boolTerminate to itemAppArray's terminated
  if boolTerminate = false then
itemAppArray's forceTerminate()
  end if
end repeat

###起動
set ocidOpenConfig to refMe's NSWorkspaceOpenConfiguration's configuration
###コンフィグ
(ocidOpenConfig's setActivates:(refMe's NSNumber's numberWithBool:true))
###起動
(appSharedWorkspace's openApplicationAtURL:(ocidAppPathURL) configuration:(ocidOpenConfig) completionHandler:(missing value))

return "再起動"

|

[bash]zoomクライアントアプリ・ユーザーインストール(ログインユーザーのみ)


【スクリプトエディタで開く】|

#!/bin/bash
#com.cocolog-nifty.quicktimer.icefloe
########################

########################################
##ユーザー
USER_WHOAMI=$(/usr/bin/whoami)
/bin/echo "実行したユーザーは:$USER_WHOAMI"

CURRENT_USER=$(/bin/echo "$HOME" | /usr/bin/awk -F'/' '{print $NF}')
/bin/echo "実行ユーザー:" "$CURRENT_USER"

USER_TEMP_DIR=$(/usr/bin/mktemp -d)
/bin/echo "起動時に削除されるディレクトリ:" "$USER_TEMP_DIR"

########################################
#起動ディスクの名前を取得する
/usr/bin/touch "$USER_TEMP_DIR/diskutil.plist"

/usr/sbin/diskutil info -plist / >"$USER_TEMP_DIR/diskutil.plist"
STARTUPDISK_NAME=$(/usr/bin/defaults read "$USER_TEMP_DIR/diskutil.plist" VolumeName)
/bin/echo "ボリューム名:" "$STARTUPDISK_NAME"

/bin/mkdir -p "$HOME/Applications"
/bin/chmod 700 "$HOME/Applications"
/usr/sbin/chown "$CURRENT_USER" "$HOME/Applications"
/usr/bin/touch "$HOME/Applications/.localized"

/bin/mkdir -p "$HOME/Applications/Utilities"
/bin/chmod 755 "$HOME/Applications/Utilities"
/usr/sbin/chown "$SUDO_USER" "$HOME/Applications/Utilities"
/usr/bin/touch "$HOME/Applications/Utilities/.localized"

/usr/bin/chflags nohidden "$HOME/Library"
/usr/bin/SetFile -a v "$HOME/Library"

#####ダウンロードディレクトリ
DOWNLOADS_DIR_PATH=$(/usr/bin/mktemp -d)
/bin/chmod 777 "$DOWNLOADS_DIR_PATH"
/bin/echo "ダウンロードディレクトリ:" "$DOWNLOADS_DIR_PATH"

#####本処理 ダウンロード

ARCHITEC=$(/usr/bin/arch)
/bin/echo "Running on $ARCHITEC"
if [ "$ARCHITEC" == "arm64" ]; then

  #######################################
  STR_URL="https://zoom.us/client/latest/ZoomMacOutlookPlugin.pkg?archType=arm64"
  ###ファイル名を取得
  PKG_FILE_NAME=$(/usr/bin/curl -s -L -I -o /dev/null -w '%{url_effective}' "$STR_URL" | /usr/bin/rev | /usr/bin/cut -d'/' -f1 | /usr/bin/rev)
  /bin/echo "PKG_FILE_NAME" "$PKG_FILE_NAME"
  if ! /usr/bin/curl -L -o "$DOWNLOADS_DIR_PATH/$PKG_FILE_NAME" "$STR_URL" --connect-timeout 20; then
    /bin/echo "ファイルのダウンロードに失敗しました HTTP1.1をトライします"
    /usr/bin/curl -L -o "$DOWNLOADS_DIR_PATH/$PKG_FILE_NAME" "$STR_URL" --http1.1 --connect-timeout 20
  fi
  ###本処理 インストール
  /usr/sbin/installer -pkg "$DOWNLOADS_DIR_PATH/$PKG_FILE_NAME" -target CurrentUserHomeDirectory -dumplog -allowUntrusted -lang ja

  #######################################
  STR_URL="https://zoom.us/client/latest/Zoom.pkg?archType=arm64"
  ###ファイル名を取得
  PKG_FILE_NAME=$(/usr/bin/curl -s -L -I -o /dev/null -w '%{url_effective}' "$STR_URL" | /usr/bin/rev | /usr/bin/cut -d'/' -f1 | /usr/bin/rev)
  /bin/echo "PKG_FILE_NAME" "$PKG_FILE_NAME"
  if ! /usr/bin/curl -L -o "$DOWNLOADS_DIR_PATH/$PKG_FILE_NAME" "$STR_URL" --connect-timeout 20; then
    /bin/echo "ファイルのダウンロードに失敗しました HTTP1.1をトライします"
    /usr/bin/curl -L -o "$DOWNLOADS_DIR_PATH/$PKG_FILE_NAME" "$STR_URL" --http1.1 --connect-timeout 20
  fi
  ###本処理 インストール
  /usr/sbin/installer -pkg "$DOWNLOADS_DIR_PATH/$PKG_FILE_NAME" -target CurrentUserHomeDirectory -dumplog -allowUntrusted -lang ja

else

  #######################################
  STR_URL="https://zoom.us/client/latest/ZoomMacOutlookPlugin.pkg?archType=x86"
  ###ファイル名を取得
  PKG_FILE_NAME=$(/usr/bin/curl -s -L -I -o /dev/null -w '%{url_effective}' "$STR_URL" | /usr/bin/rev | /usr/bin/cut -d'/' -f1 | /usr/bin/rev)
  /bin/echo "PKG_FILE_NAME" "$PKG_FILE_NAME"
  if ! /usr/bin/curl -L -o "$DOWNLOADS_DIR_PATH/$PKG_FILE_NAME" "$STR_URL" --connect-timeout 20; then
    /bin/echo "ファイルのダウンロードに失敗しました HTTP1.1をトライします"
    /usr/bin/curl -L -o "$DOWNLOADS_DIR_PATH/$PKG_FILE_NAME" "$STR_URL" --http1.1 --connect-timeout 20
  fi
  ###本処理 インストール
  /usr/sbin/installer -pkg "$DOWNLOADS_DIR_PATH/$PKG_FILE_NAME" -target CurrentUserHomeDirectory -dumplog -allowUntrusted -lang ja

  #######################################
  STR_URL="https://zoom.us/client/latest/Zoom.pkg?archType=x86"
  ###ファイル名を取得
  PKG_FILE_NAME=$(/usr/bin/curl -s -L -I -o /dev/null -w '%{url_effective}' "$STR_URL" | /usr/bin/rev | /usr/bin/cut -d'/' -f1 | /usr/bin/rev)
  /bin/echo "PKG_FILE_NAME" "$PKG_FILE_NAME"
  if ! /usr/bin/curl -L -o "$DOWNLOADS_DIR_PATH/$PKG_FILE_NAME" "$STR_URL" --connect-timeout 20; then
    /bin/echo "ファイルのダウンロードに失敗しました HTTP1.1をトライします"
    /usr/bin/curl -L -o "$DOWNLOADS_DIR_PATH/$PKG_FILE_NAME" "$STR_URL" --http1.1 --connect-timeout 20
  fi
  ###本処理 インストール
  /usr/sbin/installer -pkg "$DOWNLOADS_DIR_PATH/$PKG_FILE_NAME" -target CurrentUserHomeDirectory -dumplog -allowUntrusted -lang ja

fi

PLIST_DICT="<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>$HOME/Applications/zoom.us.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>"
/usr/bin/defaults write com.apple.dock persistent-apps -array-add "$PLIST_DICT"

/usr/bin/killall Dock

/bin/echo "処理終了しました"

exit 0


|

[bash]zoomユーザーインストール(クリーニング付き)修正

アプリケーションを正常終了させるように変更した

【スクリプトエディタで開く】|

#!/bin/bash
#com.cocolog-nifty.quicktimer.icefloe
########################

###管理者インストールしているか?チェック

USER_WHOAMI=$(/usr/bin/whoami)
echo "実行したユーザーは:$USER_WHOAMI"
if [ "$USER_WHOAMI" != "root" ]; then
  echo "このスクリプトを実行するには管理者権限が必要です。"
  echo "sudo で実行してください"
  exit 1
fi

#テンポラリーディレクトリ
STR_DATE=$(date '+%s')
/bin/mkdir -p /tmp/"$STR_DATE"
#起動ディスクの名前を取得する
/usr/bin/touch /tmp/"$STR_DATE"/diskutil.plist
/usr/sbin/diskutil info -plist / >/tmp/"$STR_DATE"/diskutil.plist
STARTUPDISK_NAME=$(/usr/bin/defaults read /private/tmp/"$STR_DATE"/diskutil.plist VolumeName)
echo "$STARTUPDISK_NAME"

/usr/bin/sudo -u "$SUDO_USER" /bin/mkdir -p "$HOME"/Applications
/usr/bin/sudo -u "$SUDO_USER" /bin/chmod 700 "$HOME"/Applications
/usr/bin/sudo -u "$SUDO_USER" /usr/sbin/chown "$SUDO_USER" "$HOME"/Applications
/usr/bin/touch "$HOME"/Applications/.localized

/usr/bin/sudo -u "$SUDO_USER" /bin/mkdir -p "$HOME"/Applications/Utilities
/usr/bin/sudo -u "$SUDO_USER" /bin/chmod 755 "$HOME"/Applications/Utilities
/usr/bin/sudo -u "$SUDO_USER" /usr/sbin/chown "$SUDO_USER" "$HOME"/Applications/Utilities
/usr/bin/touch "$HOME"/Applications/Utilities/.localized

/usr/bin/chflags nohidden "$HOME"/Library
/usr/bin/SetFile -a v "$HOME"/Library

/usr/bin/osascript -e "tell application id \"us.zoom.xos\" to quit"
sleep 2

/usr/bin/killall "zoom.us" 2>/dev/null
/usr/bin/killall "zoom.us Networking" 2>/dev/null
/usr/bin/killall "caphost" 2>/dev/null

#####古いファイルをゴミ箱に SUDO
function DO_MOVE_TO_TRASH_SUDO() {
  if [ -e "$1" ]; then
    TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/XXXXXXXX")
    /usr/bin/sudo /bin/mv "$1" "$TRASH_DIR"
    /usr/bin/sudo /bin/chmod 777 "$TRASH_DIR"
  fi
}

DO_MOVE_TO_TRASH_SUDO "/Applications/zoom.us.app"
DO_MOVE_TO_TRASH_SUDO "/Applications/ZoomOutlookPlugin"
DO_MOVE_TO_TRASH_SUDO "/Users/Shared/ZoomOutlookPlugin"
DO_MOVE_TO_TRASH_SUDO "/Library/Application Support/ZoomOutlookPlugin"
DO_MOVE_TO_TRASH_SUDO "/Library/PrivilegedHelperTools/us.zoom.ZoomDaemon"
DO_MOVE_TO_TRASH_SUDO "/Library/ScriptingAdditions/zOLPluginInjection.osax"
DO_MOVE_TO_TRASH_SUDO "/Library/Logs/zoomusinstall.log"
DO_MOVE_TO_TRASH_SUDO "/Library/Logs/zoomoutlookplugin.log"

#####古いファイルをゴミ箱に LaunchCtl
function DO_MOVE_TO_TRASH_LAUNCHCTL() {
  if [ -e "$1" ]; then
    /usr/bin/sudo /bin/launchctl stop -w "$1"
    /usr/bin/sudo /bin/launchctl unload -w "$1"
    TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/XXXXXXXX")
    /usr/bin/sudo /bin/mv "$1" "$TRASH_DIR"
    /usr/bin/sudo /bin/chmod 777 "$TRASH_DIR"
  fi
}

DO_MOVE_TO_TRASH_LAUNCHCTL "/Library/LaunchDaemons/us.zoom.ZoomDaemon.plist"
DO_MOVE_TO_TRASH_LAUNCHCTL "/Library/LaunchAgents/us.zoom.pluginagent.plist"

#####古いファイルをゴミ箱に  USER
function DO_MOVE_TO_TRASH() {
  if [ -e "$1" ]; then
    TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/XXXXXXXX")
    /bin/mv "$1" "$TRASH_DIR"
    /bin/chmod 777 "$TRASH_DIR"
  fi
}
#####古いファイルをゴミ箱に
DO_MOVE_TO_TRASH "$HOME/Applications/zoom.us.app"
DO_MOVE_TO_TRASH "$HOME/Applications/ZoomOutlookPlugin"
DO_MOVE_TO_TRASH "$HOME/Applications/Utilities/ZoomOutlookPlugin"
DO_MOVE_TO_TRASH "$HOME/Library/Caches/us.zoom.xos"
DO_MOVE_TO_TRASH "$HOME/Library/WebKit/us.zoom.xos"
DO_MOVE_TO_TRASH "$HOME/Library/HTTPStorages/us.zoom.xos"
DO_MOVE_TO_TRASH "$HOME/Library/HTTPStorages/us.zoom.xos.binarycookies"
DO_MOVE_TO_TRASH "$HOME/Library/Logs/zoomusinstall.log"
DO_MOVE_TO_TRASH "$HOME/Library/Logs/ZoomPhone"
DO_MOVE_TO_TRASH "$HOME/Library/Logs/zoom.us"
DO_MOVE_TO_TRASH "$HOME/Library/Receipts/us.zoom.pkg.videomeeting.bom"
DO_MOVE_TO_TRASH "$HOME/Library/Receipts/us.zoom.pkg.videomeeting.plist"
DO_MOVE_TO_TRASH "$HOME/Library/Receipts/ZoomMacOutlookPlugin.pkg.bom"
DO_MOVE_TO_TRASH "$HOME/Library/Receipts/ZoomMacOutlookPlugin.pkg.plist"

#####古いファイルをゴミ箱に LaunchCtl
function DO_MOVE_TO_TRASH_LAUNCHAGENT() {
  if [ -e "$1" ]; then
    /bin/launchctl stop -w "$1"
    /bin/launchctl unload -w "$1"
    TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/XXXXXXXX")
    /bin/mv "$1" "$TRASH_DIR"
  fi
}

DO_MOVE_TO_TRASH_LAUNCHAGENT "$HOME/Library/LaunchAgents/us.zoom.pluginagent.plist"

###############/var/folde TemporaryDirectory
MKTEMP_DIR=$(mktemp -d)
TEMP_DIR_T="$(dirname "$MKTEMP_DIR")"
#####古いファイルをゴミ箱に
GOTOTRASH_PATH="$TEMP_DIR_T/us.zoom.xos"
if [ -e "$GOTOTRASH_PATH" ]; then
  TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/XXXXXXXX")
  /bin/mv "$GOTOTRASH_PATH" "$TRASH_DIR"
fi

TEMP_DIR="$(dirname "$TEMP_DIR_T")"
TEMP_DIR_C="${TEMP_DIR}/C"

#####古いファイルをゴミ箱に
GOTOTRASH_PATH="$TEMP_DIR_C/us.zoom.xos"
if [ -e "$GOTOTRASH_PATH" ]; then
  TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/XXXXXXXX")
  /bin/mv "$GOTOTRASH_PATH" "$TRASH_DIR"
fi
GOTOTRASH_PATH="$TEMP_DIR_C/com.tonelib.zoom"
if [ -e "$GOTOTRASH_PATH" ]; then
  TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/XXXXXXXX")
  /bin/mv "$GOTOTRASH_PATH" "$TRASH_DIR"
fi

#####本処理 ダウンロード

ARCHITEC=$(/usr/bin/arch)
/bin/echo "Running on $ARCHITEC"
if [ "$ARCHITEC" == "arm64" ]; then
  /usr/bin/curl -L -o /tmp/"$STR_DATE"/Zoom.pkg 'https://zoom.us/client/latest/Zoom.pkg?archType=arm64' --connect-timeout 20
  /usr/bin/curl -L -o /tmp/"$STR_DATE"/ZoomMacOutlookPlugin.pkg 'https://zoom.us/client/latest/ZoomMacOutlookPlugin.pkg?archType=arm64' --connect-timeout 20
else
  /usr/bin/curl -L -o /tmp/"$STR_DATE"/Zoom.pkg 'https://zoom.us/client/latest/Zoom.pkg' --connect-timeout 20
  /usr/bin/curl -L -o /tmp/"$STR_DATE"/ZoomMacOutlookPlugin.pkg 'https://zoom.us/client/latest/ZoomMacOutlookPlugin.pkg' --connect-timeout 20
fi
###本処理 インストール
###実行しているユーザー名
SUDO_USER=$(echo "$HOME" | awk -F'/' '{print $NF}')
echo "$SUDO_USER"

/usr/bin/sudo -u "$SUDO_USER" /usr/sbin/installer -pkg /tmp/"$STR_DATE"/Zoom.pkg -target CurrentUserHomeDirectory -dumplog -allowUntrusted -lang ja

/usr/bin/sudo -u "$SUDO_USER" /usr/sbin/installer -pkg /tmp/"$STR_DATE"/ZoomMacOutlookPlugin.pkg -target CurrentUserHomeDirectory -dumplog -allowUntrusted -lang ja

PLIST_DICT="<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>$HOME/Applications/zoom.us.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>"
/usr/bin/sudo -u "$SUDO_USER" /usr/bin/defaults write com.apple.dock persistent-apps -array-add "$PLIST_DICT"

/usr/bin/killall Dock

echo "処理終了しました"

exit 0

|

[bash]zoomユーザーインストール(クリーニング付き)

設定は残すように変更した

ダウンロード - zoomuserinstall.zip




【スクリプトエディタで開く】

#!/bin/bash
#com.cocolog-nifty.quicktimer.icefloe
########################

###管理者インストールしているか?チェック

USER_WHOAMI=$(/usr/bin/whoami)
echo "実行したユーザーは:$USER_WHOAMI"
if [ "$USER_WHOAMI" != "root" ]; then
  echo "このスクリプトを実行するには管理者権限が必要です。"
  echo "sudo で実行してください"
  exit 1
fi

#テンポラリーディレクトリ
STR_DATE=$(date '+%s')
/bin/mkdir -p /tmp/"$STR_DATE"
#起動ディスクの名前を取得する
/usr/bin/touch /tmp/"$STR_DATE"/diskutil.plist
/usr/sbin/diskutil info -plist / >/tmp/"$STR_DATE"/diskutil.plist
STARTUPDISK_NAME=$(/usr/bin/defaults read /private/tmp/"$STR_DATE"/diskutil.plist VolumeName)
echo "$STARTUPDISK_NAME"

/usr/bin/sudo -u "$SUDO_USER" /bin/mkdir -p "$HOME"/Applications
/usr/bin/sudo -u "$SUDO_USER" /bin/chmod 700 "$HOME"/Applications
/usr/bin/sudo -u "$SUDO_USER" /usr/sbin/chown "$SUDO_USER" "$HOME"/Applications
/usr/bin/touch "$HOME"/Applications/.localized

/usr/bin/sudo -u "$SUDO_USER" /bin/mkdir -p "$HOME"/Applications/Utilities
/usr/bin/sudo -u "$SUDO_USER" /bin/chmod 755 "$HOME"/Applications/Utilities
/usr/bin/sudo -u "$SUDO_USER" /usr/sbin/chown "$SUDO_USER" "$HOME"/Applications/Utilities
/usr/bin/touch "$HOME"/Applications/Utilities/.localized

/usr/bin/chflags nohidden "$HOME"/Library
/usr/bin/SetFile -a v "$HOME"/Library

/usr/bin/killall "zoom.us" 2>/dev/null
/usr/bin/killall "zoom.us Networking" 2>/dev/null
/usr/bin/killall "caphost" 2>/dev/null

#####古いファイルをゴミ箱に SUDO
function DO_MOVE_TO_TRASH_SUDO() {
  if [ -e "$1" ]; then
    TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/XXXXXXXX")
    /usr/bin/sudo /bin/mv "$1" "$TRASH_DIR"
    /usr/bin/sudo /bin/chmod 777 "$TRASH_DIR"
  fi
}

DO_MOVE_TO_TRASH_SUDO "/Applications/zoom.us.app"
DO_MOVE_TO_TRASH_SUDO "/Applications/ZoomOutlookPlugin"
DO_MOVE_TO_TRASH_SUDO "/Users/Shared/ZoomOutlookPlugin"
DO_MOVE_TO_TRASH_SUDO "/Library/Application Support/ZoomOutlookPlugin"
DO_MOVE_TO_TRASH_SUDO "/Library/PrivilegedHelperTools/us.zoom.ZoomDaemon"
DO_MOVE_TO_TRASH_SUDO "/Library/ScriptingAdditions/zOLPluginInjection.osax"
DO_MOVE_TO_TRASH_SUDO "/Library/Logs/zoomusinstall.log"
DO_MOVE_TO_TRASH_SUDO "/Library/Logs/zoomoutlookplugin.log"

#####古いファイルをゴミ箱に LaunchCtl
function DO_MOVE_TO_TRASH_LAUNCHCTL() {
  if [ -e "$1" ]; then
    /usr/bin/sudo /bin/launchctl stop -w "$1"
    /usr/bin/sudo /bin/launchctl unload -w "$1"
    TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/XXXXXXXX")
    /usr/bin/sudo /bin/mv "$1" "$TRASH_DIR"
    /usr/bin/sudo /bin/chmod 777 "$TRASH_DIR"
  fi
}

DO_MOVE_TO_TRASH_LAUNCHCTL "/Library/LaunchDaemons/us.zoom.ZoomDaemon.plist"
DO_MOVE_TO_TRASH_LAUNCHCTL "/Library/LaunchAgents/us.zoom.pluginagent.plist"

#####古いファイルをゴミ箱に  USER
function DO_MOVE_TO_TRASH() {
  if [ -e "$1" ]; then
    TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/XXXXXXXX")
    /bin/mv "$1" "$TRASH_DIR"
    /bin/chmod 777 "$TRASH_DIR"
  fi
}
#####古いファイルをゴミ箱に
DO_MOVE_TO_TRASH "$HOME/Applications/zoom.us.app"
DO_MOVE_TO_TRASH "$HOME/Applications/ZoomOutlookPlugin"
DO_MOVE_TO_TRASH "$HOME/Applications/Utilities/ZoomOutlookPlugin"
DO_MOVE_TO_TRASH "$HOME/Library/Caches/us.zoom.xos"
DO_MOVE_TO_TRASH "$HOME/Library/WebKit/us.zoom.xos"
DO_MOVE_TO_TRASH "$HOME/Library/HTTPStorages/us.zoom.xos"
DO_MOVE_TO_TRASH "$HOME/Library/HTTPStorages/us.zoom.xos.binarycookies"
DO_MOVE_TO_TRASH "$HOME/Library/Logs/zoomusinstall.log"
DO_MOVE_TO_TRASH "$HOME/Library/Logs/ZoomPhone"
DO_MOVE_TO_TRASH "$HOME/Library/Logs/zoom.us"
DO_MOVE_TO_TRASH "$HOME/Library/Receipts/us.zoom.pkg.videomeeting.bom"
DO_MOVE_TO_TRASH "$HOME/Library/Receipts/us.zoom.pkg.videomeeting.plist"
DO_MOVE_TO_TRASH "$HOME/Library/Receipts/ZoomMacOutlookPlugin.pkg.bom"
DO_MOVE_TO_TRASH "$HOME/Library/Receipts/ZoomMacOutlookPlugin.pkg.plist"

#####古いファイルをゴミ箱に LaunchCtl
function DO_MOVE_TO_TRASH_LAUNCHAGENT() {
  if [ -e "$1" ]; then
    /bin/launchctl stop -w "$1"
    /bin/launchctl unload -w "$1"
    TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/XXXXXXXX")
    /bin/mv "$1" "$TRASH_DIR"
  fi
}

DO_MOVE_TO_TRASH_LAUNCHAGENT "$HOME/Library/LaunchAgents/us.zoom.pluginagent.plist"

###############/var/folde TemporaryDirectory
MKTEMP_DIR=$(mktemp -d)
TEMP_DIR_T="$(dirname "$MKTEMP_DIR")"
#####古いファイルをゴミ箱に
GOTOTRASH_PATH="$TEMP_DIR_T/us.zoom.xos"
if [ -e "$GOTOTRASH_PATH" ]; then
  TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/XXXXXXXX")
  /bin/mv "$GOTOTRASH_PATH" "$TRASH_DIR"
fi

TEMP_DIR="$(dirname "$TEMP_DIR_T")"
TEMP_DIR_C="${TEMP_DIR}/C"

#####古いファイルをゴミ箱に
GOTOTRASH_PATH="$TEMP_DIR_C/us.zoom.xos"
if [ -e "$GOTOTRASH_PATH" ]; then
  TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/XXXXXXXX")
  /bin/mv "$GOTOTRASH_PATH" "$TRASH_DIR"
fi
GOTOTRASH_PATH="$TEMP_DIR_C/com.tonelib.zoom"
if [ -e "$GOTOTRASH_PATH" ]; then
  TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/XXXXXXXX")
  /bin/mv "$GOTOTRASH_PATH" "$TRASH_DIR"
fi

#####本処理 ダウンロード

ARCHITEC=$(/usr/bin/arch)
/bin/echo "Running on $ARCHITEC"
if [ "$ARCHITEC" == "arm64" ]; then
  /usr/bin/curl -L -o /tmp/"$STR_DATE"/Zoom.pkg 'https://zoom.us/client/latest/Zoom.pkg?archType=arm64' --connect-timeout 20
  /usr/bin/curl -L -o /tmp/"$STR_DATE"/ZoomMacOutlookPlugin.pkg 'https://zoom.us/client/latest/ZoomMacOutlookPlugin.pkg?archType=arm64' --connect-timeout 20
else
  /usr/bin/curl -L -o /tmp/"$STR_DATE"/Zoom.pkg 'https://zoom.us/client/latest/Zoom.pkg' --connect-timeout 20
  /usr/bin/curl -L -o /tmp/"$STR_DATE"/ZoomMacOutlookPlugin.pkg 'https://zoom.us/client/latest/ZoomMacOutlookPlugin.pkg' --connect-timeout 20
fi
###本処理 インストール
###実行しているユーザー名
SUDO_USER=$(echo "$HOME" | awk -F'/' '{print $NF}')
echo "$SUDO_USER"

/usr/bin/sudo -u "$SUDO_USER" /usr/sbin/installer -pkg /tmp/"$STR_DATE"/Zoom.pkg -target CurrentUserHomeDirectory -dumplog -allowUntrusted -lang ja

/usr/bin/sudo -u "$SUDO_USER" /usr/sbin/installer -pkg /tmp/"$STR_DATE"/ZoomMacOutlookPlugin.pkg -target CurrentUserHomeDirectory -dumplog -allowUntrusted -lang ja

PLIST_DICT="<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>$HOME/Applications/zoom.us.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>"
/usr/bin/sudo -u "$SUDO_USER" /usr/bin/defaults write com.apple.dock persistent-apps -array-add "$PLIST_DICT"

/usr/bin/killall Dock

exit 0

|

[zoom]不具合発生時の再インストール用スクリプト

初期設定からキャッシュから
可能な限り、既存のファイルを削除します。
-->限りなく初期設定にもどる『はず』です。
不具合発生時以外の利用はお勧めしません。

ダウンロード - zoomuserinstall.scpt.zip



#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
# 注意!このスクリプトは初期設定等を削除する不具合発生時用です
# 通常時は利用しないでください
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions



set theCommandText to ("date '+%Y%m%d_%H%M%S'") as text
set theDate to (do shell script theCommandText) as text
set theDate to theDate as text



set theCommandText to ("id -un") as text
set theUserName to (do shell script theCommandText) as text
set theUserName to theUserName as text

set theCommandText to ("echo $HOME") as text
set theHomeDir to (do shell script theCommandText) as text

set theCommandText to ("mkdir -p '/tmp/" & theDate & "'") as text
do shell script theCommandText

set theCommandText to ("/usr/bin/SetFile -a v $HOME/Library") as text
do shell script theCommandText

set theCommandText to ("/usr/bin/chflags nohidden $HOME/Library") as text
do shell script theCommandText

try
set theCommandText to ("killall \"zoom.us\"") as text
do shell script theCommandText

set theCommandText to ("killall \"zoom.us Networking\"") as text
do shell script theCommandText
end try

try
set theGo2TrashPath to ("/Applications/zoom.us.app") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("" & theHomeDir & "/Applications/zoom.us.app") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("/Applications/ZoomOutlookPlugin") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("" & theHomeDir & "/Applications/ZoomOutlookPlugin") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("/Users/Shared/ZoomOutlookPlugin") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("" & theHomeDir & "/Applications/Utilities/ZoomOutlookPlugin") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("" & theHomeDir & "/Library/Application Support/zoom.us/Plugins/zMacResRetina.bundle") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("" & theHomeDir & "/Library/Application Support/zoom.us") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("" & theHomeDir & "/Library/Application Support/ZoomPresence") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("" & theHomeDir & "/Library/Caches/us.zoom.xos") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("" & theHomeDir & "/Library/Cookies/us.zoom.xos.binarycookies") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("" & theHomeDir & "/Library/HTTPStorages/us.zoom.xos.binarycookies") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("" & theHomeDir & "/Library/HTTPStorages/us.zoom.xos") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("" & theHomeDir & "/Library/Preferences/us.zoom.Transcode.plist") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("" & theHomeDir & "/Library/Preferences/us.zoom.xos.plist") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("" & theHomeDir & "/Library/Preferences/us.zoom.ZoomPresence.plist") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("" & theHomeDir & "/Library/Preferences/ZoomChat.plist") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("" & theHomeDir & "/Library/Receipts/us.zoom.pkg.videmeeting.bom") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("" & theHomeDir & "/Library/Receipts/us.zoom.pkg.videmeeting.plist") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("" & theHomeDir & "/Library/Receipts/us.zoom.pkg.videomeeting.bom") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("" & theHomeDir & "/Library/Receipts/us.zoom.pkg.videomeeting.plist") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("" & theHomeDir & "/Library/Saved Application State/us.zoom.xos.savedState") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("" & theHomeDir & "/Library/WebKit/us.zoom.xos") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("" & theHomeDir & "/Applications/ZoomOutlookPlugin") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("" & theHomeDir & "/Applications/Utilities/ZoomOutlookPlugin") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("" & theHomeDir & "/Library/Logs/zoomusinstall.log") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("" & theHomeDir & "/Library/Logs/zoom.us") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("" & theHomeDir & "/Library/Logs/ZoomPhone") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try

#########
set aliasTempFolder to (path to temporary items from user domain) as alias
tell application "Finder"
set aliasTempFolderDir to (parent of (parent of aliasTempFolder)) as alias
end tell
set theTempFolderUnixPass to (POSIX path of aliasTempFolderDir) as text
try
set theGo2TrashPath to ("" & theTempFolderUnixPass & "C/us.zoom.xos") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try
try
set theGo2TrashPath to ("" & theTempFolderUnixPass & "T/us.zoom.xos") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try

set objSysInfo to system info
set theCpuType to (CPU type of objSysInfo) as text

if theCpuType contains "Intel" then

try
set theCommandText to ("curl -L -o /tmp/" & theDate & "/Zoom.pkg 'https://zoom.us/client/latest/Zoom.pkg' --connect-timeout 20") as text
do shell script theCommandText
end try
try
set theCommandText to ("curl -L -o /tmp/" & theDate & "/ZoomMacOutlookPlugin.pkg 'https://zoom.us/client/latest/ZoomMacOutlookPlugin.pkg' --connect-timeout 20") as text
do shell script theCommandText
end try
else

try
set theCommandText to ("curl -L -o /tmp/" & theDate & "/Zoom.pkg 'https://zoom.us/client/latest/Zoom.pkg?archType=arm64' --connect-timeout 20") as text
do shell script theCommandText
try
set theCommandText to ("curl -L -o /tmp/" & theDate & "/ZoomMacOutlookPlugin.pkg 'https://zoom.us/client/latest/ZoomMacOutlookPlugin.pkg?archType=arm64' --connect-timeout 20") as text
do shell script theCommandText
end try
end try
end if
############################################################
############################################################
############################################################

set theCommandText to "date +%s"
set theSqlDateNo to (do shell script theCommandText) as text

try
set theCommandText to ("/usr/bin/tccutil reset All us.zoom.xos") as text
do shell script theCommandText
end try

try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"SELECT * FROM access\" | grep us.zoom.xos") as text
set theSqlSelect to (do shell script theCommandText) as text
end try

if theSqlSelect contains "kTCCServiceSystemPolicyAllFiles" then
try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"REPLACE INTO access VALUES('kTCCServiceSystemPolicyAllFiles','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
end try
else
try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServiceSystemPolicyAllFiles','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
end try
end if

delay 1
try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServiceScreenCapture','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
on error
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"REPLACE INTO access VALUES('kTCCServiceScreenCapture','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
end try
delay 1
try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServiceAccessibility','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
on error
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"REPLACE INTO access VALUES('kTCCServiceAccessibility','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
end try
delay 1
try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServiceCamera','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
on error
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"REPLACE INTO access VALUES('kTCCServiceCamera','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
end try
delay 1
try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServiceMicrophone','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
on error
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"REPLACE INTO access VALUES('kTCCServiceMicrophone','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
end try
delay 1
try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServiceAddressBook','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
on error
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"REPLACE INTO access VALUES('kTCCServiceAddressBook','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
end try
delay 1
try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServiceCalendar','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
on error
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"REPLACE INTO access VALUES('kTCCServiceCalendar','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
end try
delay 1
try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServiceBluetoothAlways','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
on error
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"REPLACE INTO access VALUES('kTCCServiceBluetoothAlways','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
end try
delay 1
try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServiceFileProviderDomain','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
on error
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"REPLACE INTO access VALUES('kTCCServiceFileProviderDomain','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
end try
delay 1
try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServiceSpeechRecognition','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
on error
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"REPLACE INTO access VALUES('kTCCServiceSpeechRecognition','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
end try
delay 1
try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServiceListenEvent','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
on error
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"REPLACE INTO access VALUES('kTCCServiceListenEvent','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
end try
delay 1
try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServiceUbiquity','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
on error
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"REPLACE INTO access VALUES('kTCCServiceUbiquity','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
end try
delay 1
try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServicePhotos','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
on error
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"REPLACE INTO access VALUES('kTCCServicePhotos','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
end try
delay 1
try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServicePhotosAdd','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
on error
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"REPLACE INTO access VALUES('kTCCServicePhotosAdd','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
end try
delay 1
try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServiceUbiquity','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
on error
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"REPLACE INTO access VALUES('kTCCServiceUbiquity','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
end try
delay 1
try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServiceAppleEvents','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
on error
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"REPLACE INTO access VALUES('kTCCServiceAppleEvents','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
end try
delay 1
try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServiceSystemPolicyDesktopFolder','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
on error
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"REPLACE INTO access VALUES('kTCCServiceSystemPolicyDesktopFolder','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
end try
delay 1
try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServiceSystemPolicyDocumentsFolder','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
on error
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"REPLACE INTO access VALUES('kTCCServiceSystemPolicyDocumentsFolder','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
end try
delay 1
try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServiceLiverpool','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
on error
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"REPLACE INTO access VALUES('kTCCServiceLiverpool','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
end try
delay 1
try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServiceFocusStatus','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
on error
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"REPLACE INTO access VALUES('kTCCServiceFocusStatus','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
end try
delay 1
try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServiceReminders','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
on error
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"REPLACE INTO access VALUES('kTCCServiceReminders','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
end try
delay 1
try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServiceFocusStatus','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
on error
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"REPLACE INTO access VALUES('kTCCServiceFocusStatus','us.zoom.xos',0,2,4,1, NULL, NULL,0,'UNUSED', NULL,0," & theSqlDateNo & ");\"") as text
do shell script theCommandText
end try
delay 1




#########################
try
set theCommandText to ("mkdir -p \"" & theHomeDir & "/Applications\"") as text
do shell script theCommandText
end try
try
set theCommandText to ("mkdir -p \"" & theHomeDir & "/Applications/Utilities\"") as text
do shell script theCommandText
end try
try
set theCommandText to ("touch \"" & theHomeDir & "/Applications/Utilities/.localized\"") as text
do shell script theCommandText
end try
try
set theCommandText to ("installer -pkg \"/tmp/" & theDate & "/Zoom.pkg\" -target CurrentUserHomeDirectory -dumplog -allowUntrusted -lang ja") as text
do shell script theCommandText
end try
try
set theCommandText to ("installer -pkg \"/tmp/" & theDate & "/ZoomMacOutlookPlugin.pkg\" -target CurrentUserHomeDirectory -dumplog -allowUntrusted -verboseR -lang ja") as text
do shell script theCommandText
end try
try
set theGo2TrashPath to ("/Applications/ZoomOutlookPlugin") as text
tell application "Finder"
set aliasGo2TrashPath to POSIX file theGo2TrashPath as alias
move aliasGo2TrashPath to trash
end tell
end try

try
set theCommandText to ("mv $HOME/Applications/ZoomOutlookPlugin $HOME/Applications/Utilities") as text
do shell script theCommandText
end try



try
set theCommandText to ("defaults write com.apple.dock persistent-apps -array-add \"<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Users/" & theUserName & "/Applications/zoom.us.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>\"") as text
do shell script theCommandText
end try

try
set theCommandText to ("killall Dock") as text
do shell script theCommandText
end try

|

[zoom]セキュリティ設定mobileconfig

例です。MacOS用です-->バンドルID=us.zoom.xos
カメラ、マイクはFALSE設定が必要なのでFALSEにしてあります。
値参考にして、ご自分で編集してご利用ください

ダウンロード - us.zoom.xos.mobileconfig.zip


<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

    <dict>

        <key>PayloadContent</key>

        <array>

            <dict>

                <key>Services</key>

                <dict>

                    <key>ScreenCapture</key>

                    <array>

                        <dict>

                            <key>Allowed</key>

                            <false/>

                            <key>Identifier</key>

                            <string>us.zoom.xos</string>

                            <key>IdentifierType</key>

                            <string>bundleID</string>

                            <key>Comment</key>

                            <string>Services us.zoom.xos</string>

                            <key>CodeRequirement</key>

                            <string>identifier "us.zoom.xos" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = BJ4HAAB9B3</string>

                        </dict>

                    </array>

                    <key>Camera</key>

                    <array>

                        <dict>

                            <key>Allowed</key>

                            <false/>

                            <key>Identifier</key>

                            <string>us.zoom.xos</string>

                            <key>IdentifierType</key>

                            <string>bundleID</string>

                            <key>Comment</key>

                            <string>Services us.zoom.xos</string>

                            <key>CodeRequirement</key>

                            <string>identifier "us.zoom.xos" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = BJ4HAAB9B3</string>

                        </dict>

                    </array>

                    <key>Microphone</key>

                    <array>

                        <dict>

                            <key>Allowed</key>

                            <false/>

                            <key>Identifier</key>

                            <string>us.zoom.xos</string>

                            <key>IdentifierType</key>

                            <string>bundleID</string>

                            <key>Comment</key>

                            <string>Services us.zoom.xos</string>

                            <key>CodeRequirement</key>

                            <string>identifier "us.zoom.xos" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = BJ4HAAB9B3</string>

                        </dict>

                    </array>

                    <key>ListenEvent</key>

                    <array>

                        <dict>

                            <key>Allowed</key>

                            <false/>

                            <key>Identifier</key>

                            <string>us.zoom.xos</string>

                            <key>IdentifierType</key>

                            <string>bundleID</string>

                            <key>Comment</key>

                            <string>Services us.zoom.xos</string>

                            <key>CodeRequirement</key>

                            <string>identifier "us.zoom.xos" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = BJ4HAAB9B3</string>

                        </dict>

                    </array>

                    <key>Accessibility</key>

                    <array>

                        <dict>

                            <key>Allowed</key>

                            <false/>

                            <key>Identifier</key>

                            <string>us.zoom.xos</string>

                            <key>IdentifierType</key>

                            <string>bundleID</string>

                            <key>Comment</key>

                            <string>Services us.zoom.xos</string>

                            <key>CodeRequirement</key>

                            <string>identifier "us.zoom.xos" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = BJ4HAAB9B3</string>

                        </dict>

                    </array>

                    <key>AddressBook</key>

                    <array>

                        <dict>

                            <key>Allowed</key>

                            <false/>

                            <key>Identifier</key>

                            <string>us.zoom.xos</string>

                            <key>IdentifierType</key>

                            <string>bundleID</string>

                            <key>Comment</key>

                            <string>Services us.zoom.xos</string>

                            <key>CodeRequirement</key>

                            <string>identifier "us.zoom.xos" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = BJ4HAAB9B3</string>

                        </dict>

                    </array>

                    <key>AppleEvents</key>

                    <array>

                        <dict>

                            <key>Allowed</key>

                            <true/>

                            <key>Identifier</key>

                            <string>us.zoom.xos</string>

                            <key>IdentifierType</key>

                            <string>bundleID</string>

                            <key>Comment</key>

                            <string>Services us.zoom.xos</string>

                            <key>CodeRequirement</key>

                            <string>identifier "us.zoom.xos" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = BJ4HAAB9B3</string>

                            <key>AEReceiverIdentifierType</key>

                            <string>bundleID</string>

                            <key>AEReceiverIdentifier</key>

                            <string>com.apple.finder</string>

                            <key>AEReceiverCodeRequirement</key>

                            <string>identifier "com.apple.finder" and anchor apple</string>

                        </dict>

                    </array>

                    <key>Calendar</key>

                    <array>

                        <dict>

                            <key>Allowed</key>

                            <true/>

                            <key>Identifier</key>

                            <string>us.zoom.xos</string>

                            <key>IdentifierType</key>

                            <string>bundleID</string>

                            <key>Comment</key>

                            <string>Services us.zoom.xos</string>

                            <key>CodeRequirement</key>

                            <string>identifier "us.zoom.xos" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = BJ4HAAB9B3</string>

                        </dict>

                    </array>

                    <key>FileProviderPresence</key>

                    <array>

                        <dict>

                            <key>Allowed</key>

                            <true/>

                            <key>Identifier</key>

                            <string>us.zoom.xos</string>

                            <key>IdentifierType</key>

                            <string>bundleID</string>

                            <key>Comment</key>

                            <string>Services us.zoom.xos</string>

                            <key>CodeRequirement</key>

                            <string>identifier "us.zoom.xos" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = BJ4HAAB9B3</string>

                        </dict>

                    </array>

                    <key>MediaLibrary</key>

                    <array>

                        <dict>

                            <key>Allowed</key>

                            <true/>

                            <key>Identifier</key>

                            <string>us.zoom.xos</string>

                            <key>IdentifierType</key>

                            <string>bundleID</string>

                            <key>Comment</key>

                            <string>Services us.zoom.xos</string>

                            <key>CodeRequirement</key>

                            <string>identifier "us.zoom.xos" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = BJ4HAAB9B3</string>

                        </dict>

                    </array>

                    <key>Photos</key>

                    <array>

                        <dict>

                            <key>Allowed</key>

                            <true/>

                            <key>Identifier</key>

                            <string>us.zoom.xos</string>

                            <key>IdentifierType</key>

                            <string>bundleID</string>

                            <key>Comment</key>

                            <string>Services us.zoom.xos</string>

                            <key>CodeRequirement</key>

                            <string>identifier "us.zoom.xos" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = BJ4HAAB9B3</string>

                        </dict>

                    </array>

                    <key>PostEvent</key>

                    <array>

                        <dict>

                            <key>Allowed</key>

                            <true/>

                            <key>Identifier</key>

                            <string>us.zoom.xos</string>

                            <key>IdentifierType</key>

                            <string>bundleID</string>

                            <key>Comment</key>

                            <string>Services us.zoom.xos</string>

                            <key>CodeRequirement</key>

                            <string>identifier "us.zoom.xos" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = BJ4HAAB9B3</string>

                        </dict>

                    </array>

                    <key>Reminders</key>

                    <array>

                        <dict>

                            <key>Allowed</key>

                            <true/>

                            <key>Identifier</key>

                            <string>us.zoom.xos</string>

                            <key>IdentifierType</key>

                            <string>bundleID</string>

                            <key>Comment</key>

                            <string>Services us.zoom.xos</string>

                            <key>CodeRequirement</key>

                            <string>identifier "us.zoom.xos" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = BJ4HAAB9B3</string>

                        </dict>

                    </array>

                    <key>SpeechRecognition</key>

                    <array>

                        <dict>

                            <key>Allowed</key>

                            <true/>

                            <key>Identifier</key>

                            <string>us.zoom.xos</string>

                            <key>IdentifierType</key>

                            <string>bundleID</string>

                            <key>Comment</key>

                            <string>Services us.zoom.xos</string>

                            <key>CodeRequirement</key>

                            <string>identifier "us.zoom.xos" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = BJ4HAAB9B3</string>

                        </dict>

                    </array>

                    <key>SystemPolicyAllFiles</key>

                    <array>

                        <dict>

                            <key>Allowed</key>

                            <true/>

                            <key>Identifier</key>

                            <string>us.zoom.xos</string>

                            <key>IdentifierType</key>

                            <string>bundleID</string>

                            <key>Comment</key>

                            <string>Services us.zoom.xos</string>

                            <key>CodeRequirement</key>

                            <string>identifier "us.zoom.xos" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = BJ4HAAB9B3</string>

                        </dict>

                    </array>

                    <key>SystemPolicyDesktopFolder</key>

                    <array>

                        <dict>

                            <key>Allowed</key>

                            <true/>

                            <key>Identifier</key>

                            <string>us.zoom.xos</string>

                            <key>IdentifierType</key>

                            <string>bundleID</string>

                            <key>Comment</key>

                            <string>Services us.zoom.xos</string>

                            <key>CodeRequirement</key>

                            <string>identifier "us.zoom.xos" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = BJ4HAAB9B3</string>

                        </dict>

                    </array>

                    <key>SystemPolicyDocumentsFolder</key>

                    <array>

                        <dict>

                            <key>Allowed</key>

                            <true/>

                            <key>Identifier</key>

                            <string>us.zoom.xos</string>

                            <key>IdentifierType</key>

                            <string>bundleID</string>

                            <key>Comment</key>

                            <string>Services us.zoom.xos</string>

                            <key>CodeRequirement</key>

                            <string>identifier "us.zoom.xos" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = BJ4HAAB9B3</string>

                        </dict>

                    <