[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

@@ -13,6 +13,12 @@ if is_Catalina; then
fi
fi
# Remove Parallels Desktop
# https://github.com/actions/runner-images/issues/6105
if is_Monterey; then
brew uninstall parallels
fi
# Put documentation to $HOME root
cp $HOME/image-generation/output/software-report/systeminfo.txt $HOME/image-generation/output/software-report/systeminfo.md $HOME/

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

View File

@@ -12,17 +12,13 @@ on run argv
set userpassword to item 1 of argv
set secpane to "Security & Privacy"
tell application "System Events"
tell security preferences
keystroke return
delay 5
end tell
end tell
activate application "System Preferences"
delay 5
tell application "System Events"
tell process "System Preferences"
set frontmost to true
delay 2
click menu item secpane of menu "View" of menu bar 1
delay 5
click button 1 of window 1