mirror of
https://github.com/actions/runner-images.git
synced 2025-12-17 23:28:57 +00:00
[macOS] Add Parallels Desktop extension (#6314)
* Add Parallels Desktop extension * fix typo * remove new line
This commit is contained in:
committed by
GitHub
parent
b0885e18a1
commit
3f0a28fe18
@@ -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/
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -575,6 +575,20 @@ function Build-PackageManagementEnvironmentTable {
|
||||
}
|
||||
}
|
||||
|
||||
function Build-MiscellaneousEnvironmentTable {
|
||||
return @(
|
||||
@{
|
||||
"Name" = "PARALLELS_DMG_URL"
|
||||
"Value" = $env:PARALLELS_DMG_URL
|
||||
}
|
||||
) | ForEach-Object {
|
||||
[PSCustomObject] @{
|
||||
"Name" = $_.Name
|
||||
"Value" = $_.Value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Get-GraalVMVersion {
|
||||
$version = & "$env:GRAALVM_11_ROOT\java" --version | Select-String -Pattern "GraalVM" | Take-Part -Part 5,6
|
||||
return $version
|
||||
|
||||
@@ -309,6 +309,21 @@ $markdown += New-MDList -Style Unordered -Lines (@(
|
||||
) | Sort-Object
|
||||
)
|
||||
|
||||
if ($os.IsMonterey) {
|
||||
$markdown += New-MDHeader "Environment variables" -Level 4
|
||||
$markdown += Build-MiscellaneousEnvironmentTable | New-MDTable
|
||||
$markdown += New-MDNewLine
|
||||
|
||||
$markdown += New-MDHeader "Notes:" -Level 5
|
||||
$misc = @'
|
||||
```
|
||||
If you want to use Parallels Desktop you should download a package from URL stored in
|
||||
PARALLELS_DMG_URL environment variable. A system extension is allowed for this version.
|
||||
```
|
||||
'@
|
||||
$markdown += New-MDParagraph -Lines $misc
|
||||
}
|
||||
|
||||
#
|
||||
# Generate systeminfo.txt with information about image (for debug purpose)
|
||||
#
|
||||
|
||||
@@ -181,7 +181,8 @@
|
||||
"cask_packages": [
|
||||
"julia",
|
||||
"vagrant",
|
||||
"virtualbox"
|
||||
"virtualbox",
|
||||
"parallels"
|
||||
]
|
||||
},
|
||||
"gcc": {
|
||||
|
||||
Reference in New Issue
Block a user