[Windows] win-wdk: install WDK 11 (#4014)

This commit is contained in:
Aleksandr Chebotov
2021-09-09 10:46:21 +03:00
committed by GitHub
parent 06659e17fd
commit 1052083f04
3 changed files with 49 additions and 8 deletions

View File

@@ -22,15 +22,24 @@ function Install-Binary
Param Param
( (
[Parameter(Mandatory)] [Parameter(Mandatory, ParameterSetName="Url")]
[String] $Url, [String] $Url,
[Parameter(Mandatory)] [Parameter(Mandatory, ParameterSetName="Url")]
[String] $Name, [String] $Name,
[Parameter(Mandatory, ParameterSetName="LocalPath")]
[String] $FilePath,
[String[]] $ArgumentList [String[]] $ArgumentList
) )
Write-Host "Downloading $Name..." if ($PSCmdlet.ParameterSetName -eq "LocalPath")
$filePath = Start-DownloadWithRetry -Url $Url -Name $Name {
$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 # MSI binaries should be installed via msiexec.exe
$fileExtension = ([System.IO.Path]::GetExtension($Name)).Replace(".", "") $fileExtension = ([System.IO.Path]::GetExtension($Name)).Replace(".", "")

View File

@@ -6,8 +6,8 @@
# Requires Windows SDK with the same version number as the WDK # Requires Windows SDK with the same version number as the WDK
if (Test-IsWin19) if (Test-IsWin19)
{ {
$winSdkUrl = "https://go.microsoft.com/fwlink/?linkid=2164145" $winSdkUrl = "https://go.microsoft.com/fwlink/?linkid=2166460"
$wdkUrl = "https://go.microsoft.com/fwlink/?linkid=2164149" $wdkUrl = "https://go.microsoft.com/fwlink/?linkid=2166289"
$FilePath = "C:\Program Files (x86)\Windows Kits\10\Vsix\VS2019\WDK.vsix" $FilePath = "C:\Program Files (x86)\Windows Kits\10\Vsix\VS2019\WDK.vsix"
$VSver = "2019" $VSver = "2019"
} }
@@ -25,8 +25,25 @@ else
$argumentList = ("/features", "+", "/quiet") $argumentList = ("/features", "+", "/quiet")
# `winsdksetup.exe /features + /quiet` installs all features without showing the GUI if (Test-IsWin19)
Install-Binary -Url $winSdkUrl -Name "winsdksetup.exe" -ArgumentList $argumentList {
# 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 # `wdksetup.exe /features + /quiet` installs all features without showing the GUI
Install-Binary -Url $wdkUrl -Name "wdksetup.exe" -ArgumentList $argumentList Install-Binary -Url $wdkUrl -Name "wdksetup.exe" -ArgumentList $argumentList

View File

@@ -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 { function Get-WixVersion {
$regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" $regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
$installedApplications = Get-ItemProperty -Path $regKey $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)) { if ((Test-IsWin16) -or (Test-IsWin19)) {
# Wix # Wix
$wixPackageVersion = Get-WixVersion $wixPackageVersion = Get-WixVersion
@@ -74,6 +88,7 @@ function Get-VisualStudioExtensions {
$extensions = @( $extensions = @(
$vsixs $vsixs
$ssdtPackages $ssdtPackages
$sdkPackages
$wixPackages $wixPackages
$wdkPackages $wdkPackages
) )