mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2026-01-02 15:27:16 +08:00
[Windows] Implement installation helpers refactoring (#8865)
* [Windows] Refactor base Installer helper functions * Fix helper name * Fix name gen logic and improve error handling * Fix hash checking logic * Fix Install-VsixExtension invocation * Fix variable name in Install-OpenSSL.ps1 * Fix type for git downloadUrl
This commit is contained in:
committed by
GitHub
parent
46f21c4413
commit
d3e630f774
@@ -4,33 +4,33 @@
|
||||
################################################################################
|
||||
|
||||
# Requires Windows SDK with the same version number as the WDK
|
||||
if (Test-IsWin22) {
|
||||
# SDK available through Visual Studio
|
||||
$wdkUrl = "https://go.microsoft.com/fwlink/?linkid=2249371"
|
||||
$FilePath = "C:\Program Files (x86)\Windows Kits\10\Vsix\VS2022\*\WDK.vsix"
|
||||
$wdkSignatureThumbprint = "7C94971221A799907BB45665663BBFD587BAC9F8"
|
||||
} elseif (Test-IsWin19) {
|
||||
$winSdkUrl = "https://go.microsoft.com/fwlink/?linkid=2173743"
|
||||
if (Test-IsWin19) {
|
||||
# Install all features without showing the GUI using winsdksetup.exe
|
||||
Install-Binary -Type EXE `
|
||||
-Url 'https://go.microsoft.com/fwlink/?linkid=2173743' `
|
||||
-InstallArgs @("/features", "+", "/quiet") `
|
||||
-ExpectedSignature '44796EB5BD439B4BFB078E1DC2F8345AE313CBB1'
|
||||
|
||||
$wdkUrl = "https://go.microsoft.com/fwlink/?linkid=2166289"
|
||||
$FilePath = "C:\Program Files (x86)\Windows Kits\10\Vsix\VS2019\WDK.vsix"
|
||||
$wdkSignatureThumbprint = "914A09C2E02C696AF394048BCB8D95449BCD5B9E"
|
||||
$winSdkSignatureThumbprint = "44796EB5BD439B4BFB078E1DC2F8345AE313CBB1"
|
||||
$wdkExtensionPath = "C:\Program Files (x86)\Windows Kits\10\Vsix\VS2019\WDK.vsix"
|
||||
} elseif (Test-IsWin22) {
|
||||
# SDK is available through Visual Studio
|
||||
$wdkUrl = "https://go.microsoft.com/fwlink/?linkid=2249371"
|
||||
$wdkSignatureThumbprint = "7C94971221A799907BB45665663BBFD587BAC9F8"
|
||||
$wdkExtensionPath = "C:\Program Files (x86)\Windows Kits\10\Vsix\VS2022\*\WDK.vsix"
|
||||
} else {
|
||||
throw "Invalid version of Visual Studio is found. Either 2019 or 2022 are required"
|
||||
}
|
||||
|
||||
$argumentList = ("/features", "+", "/quiet")
|
||||
|
||||
if (Test-IsWin19) {
|
||||
# `winsdksetup.exe /features + /quiet` installs all features without showing the GUI
|
||||
Install-Binary -Url $winSdkUrl -Name "winsdksetup.exe" -ArgumentList $argumentList -ExpectedSignature $winSdkSignatureThumbprint
|
||||
}
|
||||
|
||||
# `wdksetup.exe /features + /quiet` installs all features without showing the GUI
|
||||
Install-Binary -Url $wdkUrl -Name "wdksetup.exe" -ArgumentList $argumentList -ExpectedSignature $wdkSignatureThumbprint
|
||||
# Install all features without showing the GUI using wdksetup.exe
|
||||
Install-Binary -Type EXE `
|
||||
-Url $wdkUrl `
|
||||
-InstallArgs @("/features", "+", "/quiet") `
|
||||
-ExpectedSignature $wdkSignatureThumbprint
|
||||
|
||||
# Need to install the VSIX to get the build targets when running VSBuild
|
||||
$FilePath = Resolve-Path -Path $FilePath
|
||||
Install-VsixExtension -FilePath $FilePath -Name "WDK.vsix" -InstallOnly
|
||||
$wdkExtensionPath = Resolve-Path -Path $wdkExtensionPath
|
||||
Install-VsixExtension -FilePath $wdkExtensionPath -Name "WDK.vsix" -InstallOnly
|
||||
|
||||
Invoke-PesterTests -TestFile "WDK"
|
||||
|
||||
Reference in New Issue
Block a user