From ab54edda7ed1e03bbd41e05469fed54be0887538 Mon Sep 17 00:00:00 2001 From: susmitamane Date: Tue, 11 Mar 2025 20:56:27 +0530 Subject: [PATCH] [macOS] Add parallels to macOS 15 images. (#11749) --------- Co-authored-by: sureshe456 <160699174+sureshe456@users.noreply.github.com> Co-authored-by: Erik Bershel <110455084+erik-bershel@users.noreply.github.com> --- .../macos/scripts/build/configure-system.sh | 2 +- .../scripts/build/install-common-utils.sh | 11 +++--- .../docs-gen/Generate-SoftwareReport.ps1 | 7 ++-- ...confirm-identified-developers-macos15.scpt | 34 +++++++++++++++++++ images/macos/templates/macOS-15.anka.pkr.hcl | 1 + images/macos/toolsets/toolset-15.json | 2 +- 6 files changed, 49 insertions(+), 8 deletions(-) create mode 100644 images/macos/scripts/helpers/confirm-identified-developers-macos15.scpt diff --git a/images/macos/scripts/build/configure-system.sh b/images/macos/scripts/build/configure-system.sh index 62fdb5bfc..77983c416 100644 --- a/images/macos/scripts/build/configure-system.sh +++ b/images/macos/scripts/build/configure-system.sh @@ -12,7 +12,7 @@ close_finder_window # Remove Parallels Desktop # https://github.com/actions/runner-images/issues/6105 # https://github.com/actions/runner-images/issues/10143 -if is_SonomaX64 || is_VenturaX64; then +if is_SonomaX64 || is_VenturaX64 || is_SequoiaX64; then brew uninstall parallels fi diff --git a/images/macos/scripts/build/install-common-utils.sh b/images/macos/scripts/build/install-common-utils.sh index bdab996d1..1cbcac954 100644 --- a/images/macos/scripts/build/install-common-utils.sh +++ b/images/macos/scripts/build/install-common-utils.sh @@ -35,13 +35,13 @@ for package in $cask_packages; do done # Load "Parallels International GmbH" -if is_SonomaX64 || is_VenturaX64; then +if is_SonomaX64 || is_VenturaX64 || is_SequoiaX64; then sudo kextload /Applications/Parallels\ Desktop.app/Contents/Library/Extensions/10.9/prl_hypervisor.kext || true fi -# Execute AppleScript to change security preferences for macOS12, macOS13 and macOS14 +# Execute AppleScript to change security preferences for macOS12, macOS13, macOS14 and macOS15 # System Preferences -> Security & Privacy -> General -> Unlock -> Allow -> Not now -if is_SonomaX64 || is_VenturaX64; then +if is_SonomaX64 || is_VenturaX64 || is_SequoiaX64; then for retry in {4..0}; do echo "Executing AppleScript to change security preferences. Retries left: $retry" { @@ -54,6 +54,9 @@ if is_SonomaX64 || is_VenturaX64; then if is_SonomaX64; then osascript $HOME/utils/confirm-identified-developers-macos14.scpt $USER_PASSWORD fi + if is_SequoiaX64; then + osascript $HOME/utils/confirm-identified-developers-macos15.scpt $USER_PASSWORD + fi } && break if [[ $retry -eq 0 ]]; then @@ -67,7 +70,7 @@ if is_SonomaX64 || is_VenturaX64; then fi # Validate "Parallels International GmbH" kext -if is_SonomaX64 || is_VenturaX64; then +if is_SonomaX64 || is_VenturaX64 || is_SequoiaX64; then echo "Closing System Settings window if it is still opened" killall "System Settings" || true diff --git a/images/macos/scripts/docs-gen/Generate-SoftwareReport.ps1 b/images/macos/scripts/docs-gen/Generate-SoftwareReport.ps1 index a099454b8..edeae3fea 100644 --- a/images/macos/scripts/docs-gen/Generate-SoftwareReport.ps1 +++ b/images/macos/scripts/docs-gen/Generate-SoftwareReport.ps1 @@ -174,12 +174,15 @@ $android.AddTable($androidTable) $androidEnv = $android.AddHeader("Environment variables") $androidEnv.AddTable($(Build-AndroidEnvironmentTable)) -if ($os.IsSonoma -or $os.IsVentura) { +if ($os.IsSonoma -or $os.IsVentura -or $os.IsSequoiaX64) { $miscellaneous = $installedSoftware.AddHeader("Miscellaneous") +} + +if ($os.IsSonoma -or $os.IsVentura) { $miscellaneous.AddToolVersion("Tcl/Tk", $(Get-TclTkVersion)) } -if ($os.IsSonomaX64 -or $os.IsVenturaX64) { +if ($os.IsSonomaX64 -or $os.IsVenturaX64 -or $os.IsSequoiaX64) { Write-Host "Adding environment variables for parallels" diff --git a/images/macos/scripts/helpers/confirm-identified-developers-macos15.scpt b/images/macos/scripts/helpers/confirm-identified-developers-macos15.scpt new file mode 100644 index 000000000..75073de98 --- /dev/null +++ b/images/macos/scripts/helpers/confirm-identified-developers-macos15.scpt @@ -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 27 of outline 1 of scroll area 1 of group 1 + delay 5 + click UI element 1 of row 27 of outline 1 of scroll area 1 of group 1 + delay 5 + keystroke userpassword + delay 5 + keystroke return + delay 5 + end tell + end tell + end tell +end run diff --git a/images/macos/templates/macOS-15.anka.pkr.hcl b/images/macos/templates/macOS-15.anka.pkr.hcl index 618478dd7..4d78f10b9 100644 --- a/images/macos/templates/macOS-15.anka.pkr.hcl +++ b/images/macos/templates/macOS-15.anka.pkr.hcl @@ -156,6 +156,7 @@ build { inline = [ "mv ${local.image_folder}/docs-gen ${local.image_folder}/software-report", "mkdir ~/utils", + "mv ${local.image_folder}/helpers/confirm-identified-developers-macos15.scpt ~/utils", "mv ${local.image_folder}/helpers/invoke-tests.sh ~/utils", "mv ${local.image_folder}/helpers/utils.sh ~/utils" ] diff --git a/images/macos/toolsets/toolset-15.json b/images/macos/toolsets/toolset-15.json index db8f85597..b5ce5d1da 100644 --- a/images/macos/toolsets/toolset-15.json +++ b/images/macos/toolsets/toolset-15.json @@ -85,7 +85,7 @@ "xcodes" ], "cask_packages": [ - "" + "parallels" ] }, "gcc": {