Merge pull request #66619 from dwoz/test_fix

[3006.x] Make windows pkg builds more reliable
This commit is contained in:
Daniel Wozniak 2024-06-05 15:07:48 -07:00 committed by GitHub
commit e6ad2cc4db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -119,12 +119,12 @@ if ( $install_build_tools ) {
# Hash: 3b1efd3a66ea28b16697394703a72ca340a05bd5 # Hash: 3b1efd3a66ea28b16697394703a72ca340a05bd5
if (! (Test-Path -Path Cert:\LocalMachine\Root\3b1efd3a66ea28b16697394703a72ca340a05bd5) ) { if (! (Test-Path -Path Cert:\LocalMachine\Root\3b1efd3a66ea28b16697394703a72ca340a05bd5) ) {
Write-Host "Installing Certificate Sign Root Certificate: " -NoNewLine Write-Host "Installing Certificate Sign Root Certificate: " -NoNewLine
Start-Process -FilePath "certutil" ` $proc = Start-Process -FilePath "certutil" `
-ArgumentList "-addstore", ` -ArgumentList "-addstore", `
"Root", ` "Root", `
"$env:TEMP\build_tools\certificates\manifestCounterSignRootCertificate.cer" ` "$($env:TEMP)\build_tools\certificates\manifestCounterSignRootCertificate.cer" `
-Wait -WindowStyle Hidden -PassThru -Wait -WindowStyle Hidden
if ( Test-Path -Path Cert:\LocalMachine\Root\3b1efd3a66ea28b16697394703a72ca340a05bd5 ) { if ( $proc.ExitCode -eq 0 ) {
Write-Result "Success" -ForegroundColor Green Write-Result "Success" -ForegroundColor Green
} else { } else {
Write-Result "Failed" -ForegroundColor Yellow Write-Result "Failed" -ForegroundColor Yellow
@ -135,12 +135,12 @@ if ( $install_build_tools ) {
# Hash: 8f43288ad272f3103b6fb1428485ea3014c0bcfe # Hash: 8f43288ad272f3103b6fb1428485ea3014c0bcfe
if (! (Test-Path -Path Cert:\LocalMachine\Root\8f43288ad272f3103b6fb1428485ea3014c0bcfe) ) { if (! (Test-Path -Path Cert:\LocalMachine\Root\8f43288ad272f3103b6fb1428485ea3014c0bcfe) ) {
Write-Host "Installing Certificate Root Certificate: " -NoNewLine Write-Host "Installing Certificate Root Certificate: " -NoNewLine
Start-Process -FilePath "certutil" ` $proc = Start-Process -FilePath "certutil" `
-ArgumentList "-addstore", ` -ArgumentList "-addstore", `
"Root", ` "Root", `
"$env:TEMP\build_tools\certificates\manifestRootCertificate.cer" ` "$($env:TEMP)\build_tools\certificates\manifestRootCertificate.cer" `
-Wait -WindowStyle Hidden -PassThru -Wait -WindowStyle Hidden
if ( Test-Path -Path Cert:\LocalMachine\Root\8f43288ad272f3103b6fb1428485ea3014c0bcfe ) { if ( $proc.ExitCode -eq 0 ) {
Write-Result "Success" -ForegroundColor Green Write-Result "Success" -ForegroundColor Green
} else { } else {
Write-Result "Failed" -ForegroundColor Yellow Write-Result "Failed" -ForegroundColor Yellow
@ -148,14 +148,13 @@ if ( $install_build_tools ) {
} }
Write-Host "Installing Visual Studio 2017 build tools: " -NoNewline Write-Host "Installing Visual Studio 2017 build tools: " -NoNewline
Start-Process -FilePath "$env:TEMP\build_tools\vs_setup.exe" ` $proc = Start-Process -FilePath "$env:TEMP\build_tools\vs_setup.exe" `
-ArgumentList "--wait", "--noweb", "--quiet" ` -ArgumentList "--wait", "--noweb", "--quiet" `
-Wait -Wait -PassThru
@($VS_CL_BIN, $MSBUILD_BIN, $WIN10_SDK_RC) | ForEach-Object { if ( $proc.ExitCode -eq 0 ) {
if ( ! (Test-Path -Path $_) ) { Write-Result "Success" -ForegroundColor Green
Write-Result "Failed" -ForegroundColor Red } else {
exit 1 Write-Result "Failed" -ForegroundColor Yellow
}
} }
Write-Result "Success" -ForegroundColor Green Write-Result "Success" -ForegroundColor Green
} else { } else {