[macOS] Add Parallels Desktop extension (#6314)

* Add Parallels Desktop extension

* fix typo

* remove new line
This commit is contained in:
Aleksandr Chebotov
2022-09-28 19:06:08 +02:00
committed by GitHub
parent b0885e18a1
commit 3f0a28fe18
6 changed files with 66 additions and 9 deletions

View File

@@ -16,7 +16,12 @@ for package in $cask_packages; do
brew install --cask $package
done
# Execute AppleScript to change security preferences for virtualbox
# Load "Parallels International GmbH"
if is_Monterey; then
sudo kextload /Applications/Parallels\ Desktop.app/Contents/Library/Extensions/10.9/prl_hypervisor.kext || true
fi
# Execute AppleScript to change security preferences
# System Preferences -> Security & Privacy -> General -> Unlock -> Allow -> Not now
if is_Monterey; then
if is_Veertu; then
@@ -38,6 +43,26 @@ if is_Monterey; then
osascript $HOME/utils/confirm-identified-developers.scpt $USER_PASSWORD
fi
# Validate "Parallels International GmbH" kext
if is_Monterey; then
dbName="/var/db/SystemPolicyConfiguration/KextPolicy"
dbQuery="SELECT * FROM kext_policy WHERE bundle_id LIKE 'com.parallels.kext.%';"
kext=$(sudo sqlite3 $dbName "$dbQuery")
if [ -z "$kext" ]; then
echo "Parallels International GmbH not found"
exit 1
fi
# Create env variable
url=$(brew info --json=v2 --installed | jq -r '.casks[] | select(.name[] == "Parallels Desktop").url')
if [ -z "$url" ]; then
echo "Unable to parse url for Parallels Desktop cask"
exit 1
fi
echo "export PARALLELS_DMG_URL=$url" >> "${HOME}/.bashrc"
fi
# Invoke bazel to download bazel version via bazelisk
bazel