mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-14 13:56:47 +00:00
[Windows] win-wdk: install WDK 11 (#4014)
This commit is contained in:
committed by
GitHub
parent
06659e17fd
commit
1052083f04
@@ -22,15 +22,24 @@ function Install-Binary
|
||||
|
||||
Param
|
||||
(
|
||||
[Parameter(Mandatory)]
|
||||
[Parameter(Mandatory, ParameterSetName="Url")]
|
||||
[String] $Url,
|
||||
[Parameter(Mandatory)]
|
||||
[Parameter(Mandatory, ParameterSetName="Url")]
|
||||
[String] $Name,
|
||||
[Parameter(Mandatory, ParameterSetName="LocalPath")]
|
||||
[String] $FilePath,
|
||||
[String[]] $ArgumentList
|
||||
)
|
||||
|
||||
Write-Host "Downloading $Name..."
|
||||
$filePath = Start-DownloadWithRetry -Url $Url -Name $Name
|
||||
if ($PSCmdlet.ParameterSetName -eq "LocalPath")
|
||||
{
|
||||
$name = Split-Path -Path $FilePath -Leaf
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Downloading $Name..."
|
||||
$filePath = Start-DownloadWithRetry -Url $Url -Name $Name
|
||||
}
|
||||
|
||||
# MSI binaries should be installed via msiexec.exe
|
||||
$fileExtension = ([System.IO.Path]::GetExtension($Name)).Replace(".", "")
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
# Requires Windows SDK with the same version number as the WDK
|
||||
if (Test-IsWin19)
|
||||
{
|
||||
$winSdkUrl = "https://go.microsoft.com/fwlink/?linkid=2164145"
|
||||
$wdkUrl = "https://go.microsoft.com/fwlink/?linkid=2164149"
|
||||
$winSdkUrl = "https://go.microsoft.com/fwlink/?linkid=2166460"
|
||||
$wdkUrl = "https://go.microsoft.com/fwlink/?linkid=2166289"
|
||||
$FilePath = "C:\Program Files (x86)\Windows Kits\10\Vsix\VS2019\WDK.vsix"
|
||||
$VSver = "2019"
|
||||
}
|
||||
@@ -25,8 +25,25 @@ else
|
||||
|
||||
$argumentList = ("/features", "+", "/quiet")
|
||||
|
||||
# `winsdksetup.exe /features + /quiet` installs all features without showing the GUI
|
||||
Install-Binary -Url $winSdkUrl -Name "winsdksetup.exe" -ArgumentList $argumentList
|
||||
if (Test-IsWin19)
|
||||
{
|
||||
# Download WDK ISO file
|
||||
$isoPath = Start-DownloadWithRetry -Url $winSdkUrl -Name winsdk.iso
|
||||
$diskImage = Mount-DiskImage -ImagePath $isoPath
|
||||
$driveLetter = ($diskImage | Get-Volume).DriveLetter
|
||||
$sdkPath = Join-Path "${driveLetter}:\" "winsdksetup.exe"
|
||||
|
||||
# `winsdksetup.exe /features + /quiet` installs all features without showing the GUI
|
||||
Install-Binary -FilePath $sdkPath -ArgumentList $argumentList
|
||||
|
||||
# Dismount ISO
|
||||
Dismount-DiskImage -DevicePath $diskImage.DevicePath | Out-Null
|
||||
}
|
||||
else
|
||||
{
|
||||
# `winsdksetup.exe /features + /quiet` installs all features without showing the GUI
|
||||
Install-Binary -Url $winSdkUrl -Name "winsdksetup.exe" -ArgumentList $argumentList
|
||||
}
|
||||
|
||||
# `wdksetup.exe /features + /quiet` installs all features without showing the GUI
|
||||
Install-Binary -Url $wdkUrl -Name "wdksetup.exe" -ArgumentList $argumentList
|
||||
|
||||
@@ -7,6 +7,12 @@ function Get-VisualStudioVersion {
|
||||
}
|
||||
}
|
||||
|
||||
function Get-SDKVersion {
|
||||
$regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
|
||||
$installedApplications = Get-ItemProperty -Path $regKey
|
||||
($installedApplications | Where-Object { $_.DisplayName -eq 'Windows SDK' } | Select-Object -First 1).DisplayVersion
|
||||
}
|
||||
|
||||
function Get-WixVersion {
|
||||
$regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
|
||||
$installedApplications = Get-ItemProperty -Path $regKey
|
||||
@@ -52,6 +58,14 @@ function Get-VisualStudioExtensions {
|
||||
)
|
||||
}
|
||||
|
||||
# SDK
|
||||
if (Test-IsWin19) {
|
||||
$sdkPackageVersion = Get-SDKVersion
|
||||
$sdkPackages = @(
|
||||
@{Package = 'Windows Software Development Kit Extension'; Version = $sdkPackageVersion}
|
||||
)
|
||||
}
|
||||
|
||||
if ((Test-IsWin16) -or (Test-IsWin19)) {
|
||||
# Wix
|
||||
$wixPackageVersion = Get-WixVersion
|
||||
@@ -74,6 +88,7 @@ function Get-VisualStudioExtensions {
|
||||
$extensions = @(
|
||||
$vsixs
|
||||
$ssdtPackages
|
||||
$sdkPackages
|
||||
$wixPackages
|
||||
$wdkPackages
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user