diff --git a/images/win/scripts/ImageHelpers/InstallHelpers.ps1 b/images/win/scripts/ImageHelpers/InstallHelpers.ps1 index ececdce8..76f093b5 100644 --- a/images/win/scripts/ImageHelpers/InstallHelpers.ps1 +++ b/images/win/scripts/ImageHelpers/InstallHelpers.ps1 @@ -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(".", "") diff --git a/images/win/scripts/Installers/Install-WDK.ps1 b/images/win/scripts/Installers/Install-WDK.ps1 index c272da54..052245b6 100644 --- a/images/win/scripts/Installers/Install-WDK.ps1 +++ b/images/win/scripts/Installers/Install-WDK.ps1 @@ -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 diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.VisualStudio.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.VisualStudio.psm1 index 21f2e5dd..341c5dc4 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.VisualStudio.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.VisualStudio.psm1 @@ -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 )