mirror of
https://github.com/actions/runner-images.git
synced 2025-12-11 03:27:05 +00:00
[macOS] Add parallels kernel extension to macOS13 and macOS14 (#10238)
[macOS] Add parallels kernel extension to macOS13 and macOS14
This commit is contained in:
committed by
GitHub
parent
59a0b3727b
commit
c634b8cd67
@@ -11,7 +11,8 @@ close_finder_window
|
||||
|
||||
# Remove Parallels Desktop
|
||||
# https://github.com/actions/runner-images/issues/6105
|
||||
if is_Monterey; then
|
||||
# https://github.com/actions/runner-images/issues/10143
|
||||
if is_Monterey || is_SonomaX64 || is_VenturaX64; then
|
||||
brew uninstall parallels
|
||||
fi
|
||||
|
||||
|
||||
@@ -30,24 +30,38 @@ for package in $cask_packages; do
|
||||
virtualbox_cask_path=$(download_with_retry "https://raw.githubusercontent.com/Homebrew/homebrew-cask/aa3c55951fc9d687acce43e5c0338f42c1ddff7b/Casks/virtualbox.rb")
|
||||
brew install $virtualbox_cask_path
|
||||
else
|
||||
brew install --cask $package
|
||||
if is_Arm64 && [[ $package == "parallels" ]]; then
|
||||
echo "Parallels installation is skipped for arm64 architecture"
|
||||
else
|
||||
brew install --cask $package
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# Load "Parallels International GmbH"
|
||||
if is_Monterey; then
|
||||
if is_Monterey || is_SonomaX64 || is_VenturaX64; then
|
||||
sudo kextload /Applications/Parallels\ Desktop.app/Contents/Library/Extensions/10.9/prl_hypervisor.kext || true
|
||||
fi
|
||||
|
||||
# Execute AppleScript to change security preferences
|
||||
# Execute AppleScript to change security preferences for macOS12, macOS13 and macOS14
|
||||
# System Preferences -> Security & Privacy -> General -> Unlock -> Allow -> Not now
|
||||
if is_Monterey; then
|
||||
if is_Monterey || is_SonomaX64 || is_VenturaX64; then
|
||||
for retry in {4..0}; do
|
||||
echo "Executing AppleScript to change security preferences. Retries left: $retry"
|
||||
{
|
||||
set -e
|
||||
osascript -e 'tell application "System Events" to get application processes where visible is true'
|
||||
osascript $HOME/utils/confirm-identified-developers.scpt $USER_PASSWORD
|
||||
if is_Monterey; then
|
||||
osascript $HOME/utils/confirm-identified-developers.scpt $USER_PASSWORD
|
||||
fi
|
||||
|
||||
if is_VenturaX64; then
|
||||
osascript $HOME/utils/confirm-identified-developers-macos13.scpt $USER_PASSWORD
|
||||
fi
|
||||
|
||||
if is_SonomaX64; then
|
||||
osascript $HOME/utils/confirm-identified-developers-macos14.scpt $USER_PASSWORD
|
||||
fi
|
||||
} && break
|
||||
|
||||
if [[ $retry -eq 0 ]]; then
|
||||
@@ -61,9 +75,17 @@ if is_Monterey; then
|
||||
fi
|
||||
|
||||
# Validate "Parallels International GmbH" kext
|
||||
if is_Monterey; then
|
||||
echo "Closing System Preferences window if it is still opened"
|
||||
killall "System Preferences" || true
|
||||
if is_Monterey || is_SonomaX64 || is_VenturaX64; then
|
||||
|
||||
if is_Monterey; then
|
||||
echo "Closing System Preferences window if it is still opened"
|
||||
killall "System Preferences" || true
|
||||
fi
|
||||
|
||||
if is_SonomaX64 || is_VenturaX64; then
|
||||
echo "Closing System Settings window if it is still opened"
|
||||
killall "System Settings" || true
|
||||
fi
|
||||
|
||||
echo "Checking parallels kexts"
|
||||
dbName="/var/db/SystemPolicyConfiguration/KextPolicy"
|
||||
|
||||
@@ -290,7 +290,13 @@ if ($os.IsMonterey) {
|
||||
$miscellaneous.AddToolVersion("Zlib", $(Get-ZlibVersion))
|
||||
}
|
||||
|
||||
if ($os.IsMonterey) {
|
||||
if ($os.IsSonomaX64 -or $os.IsVenturaX64) {
|
||||
$miscellaneous = $installedSoftware.AddHeader("Miscellaneous")
|
||||
}
|
||||
if ($os.IsMonterey -or $os.IsSonomaX64 -or $os.IsVenturaX64) {
|
||||
|
||||
Write-Host "Adding environment variables for parallels"
|
||||
|
||||
$miscellaneousEnv = $miscellaneous.AddHeader("Environment variables")
|
||||
$miscellaneousEnv.AddTable($(Build-MiscellaneousEnvironmentTable))
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# This AppleScript clicks "Allow" for "System Software from developer "Parallels International GmbH"
|
||||
# Steps:
|
||||
# - Open System Settings -> Privacy & Security
|
||||
# - Click 'Allow' for 'System Software from developer "Parallels International GmbH'
|
||||
# - Enter password for runner
|
||||
|
||||
on run argv
|
||||
set userpassword to item 1 of argv
|
||||
|
||||
tell application "System Settings"
|
||||
activate
|
||||
delay 5
|
||||
end tell
|
||||
|
||||
tell application "System Events"
|
||||
tell process "System Settings"
|
||||
set frontmost to true
|
||||
repeat until exists window 1
|
||||
delay 2
|
||||
end repeat
|
||||
|
||||
tell splitter group 1 of group 1 of window 1
|
||||
select row 20 of outline 1 of scroll area 1 of group 1
|
||||
delay 5
|
||||
click UI Element 2 of group 4 of scroll area 1 of group 1 of group 2
|
||||
delay 5
|
||||
keystroke userpassword
|
||||
delay 5
|
||||
keystroke return
|
||||
delay 5
|
||||
end tell
|
||||
end tell
|
||||
end tell
|
||||
end run
|
||||
@@ -0,0 +1,34 @@
|
||||
# This AppleScript clicks "Allow" for "System Software from developer "Parallels International GmbH"
|
||||
# Steps:
|
||||
# - Open System Settings -> Privacy & Security
|
||||
# - Click 'Allow' for 'System Software from developer "Parallels International GmbH'
|
||||
# - Enter password for runner
|
||||
|
||||
on run argv
|
||||
set userpassword to item 1 of argv
|
||||
|
||||
tell application "System Settings"
|
||||
activate
|
||||
delay 5
|
||||
end tell
|
||||
|
||||
tell application "System Events"
|
||||
tell process "System Settings"
|
||||
set frontmost to true
|
||||
repeat until exists window 1
|
||||
delay 2
|
||||
end repeat
|
||||
|
||||
tell splitter group 1 of group 1 of window 1
|
||||
select row 18 of outline 1 of scroll area 1 of group 1
|
||||
delay 5
|
||||
click UI Element 2 of group 5 of scroll area 1 of group 1 of group 2
|
||||
delay 5
|
||||
keystroke userpassword
|
||||
delay 5
|
||||
keystroke return
|
||||
delay 5
|
||||
end tell
|
||||
end tell
|
||||
end tell
|
||||
end run
|
||||
@@ -157,7 +157,7 @@ build {
|
||||
"mv ${local.image_folder}/docs-gen ${local.image_folder}/software-report",
|
||||
"mv ${local.image_folder}/xamarin-selector ${local.image_folder}/assets",
|
||||
"mkdir ~/utils",
|
||||
"mv ${local.image_folder}/helpers/confirm-identified-developers.scpt ~/utils",
|
||||
"mv ${local.image_folder}/helpers/confirm-identified-developers-macos13.scpt ~/utils",
|
||||
"mv ${local.image_folder}/helpers/invoke-tests.sh ~/utils",
|
||||
"mv ${local.image_folder}/helpers/utils.sh ~/utils",
|
||||
"mv ${local.image_folder}/helpers/xamarin-utils.sh ~/utils"
|
||||
|
||||
@@ -157,7 +157,7 @@ build {
|
||||
"mv ${local.image_folder}/docs-gen ${local.image_folder}/software-report",
|
||||
"mv ${local.image_folder}/xamarin-selector ${local.image_folder}/assets",
|
||||
"mkdir ~/utils",
|
||||
"mv ${local.image_folder}/helpers/confirm-identified-developers.scpt ~/utils",
|
||||
"mv ${local.image_folder}/helpers/confirm-identified-developers-macos14.scpt ~/utils",
|
||||
"mv ${local.image_folder}/helpers/invoke-tests.sh ~/utils",
|
||||
"mv ${local.image_folder}/helpers/utils.sh ~/utils",
|
||||
"mv ${local.image_folder}/helpers/xamarin-utils.sh ~/utils"
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
"xcodes"
|
||||
],
|
||||
"cask_packages": [
|
||||
""
|
||||
"parallels"
|
||||
]
|
||||
},
|
||||
"gcc": {
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
"xcodes"
|
||||
],
|
||||
"cask_packages": [
|
||||
""
|
||||
"parallels"
|
||||
]
|
||||
},
|
||||
"gcc": {
|
||||
|
||||
Reference in New Issue
Block a user