mirror of
https://github.com/actions/runner-images.git
synced 2025-12-20 06:35:47 +00:00
[Windows] Add signature validation (#8390)
This commit is contained in:
@@ -28,7 +28,8 @@ Function Install-VisualStudio {
|
||||
[Parameter(Mandatory)] [String] $Edition,
|
||||
[Parameter(Mandatory)] [String] $Channel,
|
||||
[Parameter(Mandatory)] [String[]] $RequiredComponents,
|
||||
[String] $ExtraArgs = ""
|
||||
[String] $ExtraArgs = "",
|
||||
[Parameter(Mandatory)] [String] $SignatureThumbprint
|
||||
)
|
||||
|
||||
$bootstrapperUrl = "https://aka.ms/vs/${Version}/${Channel}/vs_${Edition}.exe"
|
||||
@@ -40,6 +41,9 @@ Function Install-VisualStudio {
|
||||
$BootstrapperName = [IO.Path]::GetFileName($BootstrapperUrl)
|
||||
$bootstrapperFilePath = Start-DownloadWithRetry -Url $BootstrapperUrl -Name $BootstrapperName
|
||||
|
||||
# Verify that the bootstrapper is signed by Microsoft
|
||||
Test-FileSignature -FilePath $bootstrapperFilePath -ExpectedThumbprint $SignatureThumbprint
|
||||
|
||||
try {
|
||||
Write-Host "Enable short name support on Windows needed for Xamarin Android AOT, defaults appear to have been changed in Azure VMs"
|
||||
$shortNameEnableProcess = Start-Process -FilePath fsutil.exe -ArgumentList ('8dot3name', 'set', '0') -Wait -PassThru
|
||||
@@ -124,4 +128,4 @@ function Get-VisualStudioComponents {
|
||||
(Get-VisualStudioInstance).Packages | Where-Object type -in 'Component', 'Workload' |
|
||||
Sort-Object Id, Version | Select-Object @{n = 'Package'; e = {$_.Id}}, Version |
|
||||
Where-Object { $_.Package -notmatch "[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}" }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user