From 0447a62037cfb3a5d4e5df598ed1e5a5c0363284 Mon Sep 17 00:00:00 2001 From: Frank Richter Date: Sat, 20 Jul 2024 21:03:38 +0200 Subject: [PATCH 1/4] Don't throw WinSDK setup exit code away --- externals/install-winsdk.ps1 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/externals/install-winsdk.ps1 b/externals/install-winsdk.ps1 index d9bf676..c2c93b1 100644 --- a/externals/install-winsdk.ps1 +++ b/externals/install-winsdk.ps1 @@ -314,8 +314,16 @@ if ($InstallWindowsSDK) Write-Host -NoNewLine "Installing WinSDK..." $setupPath = Join-Path "$isoDrive" "WinSDKSetup.exe" - Start-Process -Wait $setupPath "/features $WindowsSDKOptions /q" - Write-Host "Done" + $setupProcess = (Start-Process -PassThru -Wait $setupPath "/features $WindowsSDKOptions /q") + if ($setupProcess.ExitCode -ne 0) + { + Write-Host "Failed! Exit code: $($setupProcess.ExitCode)" + Exit $setupProcess.ExitCode + } + else + { + Write-Host "Done" + } } else { From 5ba62b34a9d3d02b896ef0b4a86b6445bab5c522 Mon Sep 17 00:00:00 2001 From: Frank Richter Date: Sat, 20 Jul 2024 21:38:16 +0200 Subject: [PATCH 2/4] Dump WinSDK setup logs in case of an error --- externals/install-winsdk.ps1 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/externals/install-winsdk.ps1 b/externals/install-winsdk.ps1 index c2c93b1..1b7c00a 100644 --- a/externals/install-winsdk.ps1 +++ b/externals/install-winsdk.ps1 @@ -234,6 +234,21 @@ function Test-InstallStrongNameHijack return $false } +function Dump-Install-Logs +{ + param ( + [parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] $winsdkTempDir) + + foreach($logfile in (Get-ChildItem "$winsdkTempDir\*.log")) + { + Write-Host "::group::Contents of ${logfile}:" + Get-Content $logfile + Write-Host "::endgroup::" + } +} + Write-Host -NoNewline "Checking for installed Windows SDK $WindowsSDKVersion..." $InstallWindowsSDK = Test-InstallWindowsSDK if ($InstallWindowsSDK) @@ -318,6 +333,7 @@ if ($InstallWindowsSDK) if ($setupProcess.ExitCode -ne 0) { Write-Host "Failed! Exit code: $($setupProcess.ExitCode)" + Dump-Install-Logs $winsdkTempDir Exit $setupProcess.ExitCode } else From 0b95a3c7baf01106e2e1940ff61fc183db3ee7cf Mon Sep 17 00:00:00 2001 From: Frank Richter Date: Sun, 21 Jul 2024 13:28:12 +0200 Subject: [PATCH 3/4] Fix for feature removed in SDK 26100 --- externals/install-winsdk.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/externals/install-winsdk.ps1 b/externals/install-winsdk.ps1 index 1b7c00a..feecf87 100644 --- a/externals/install-winsdk.ps1 +++ b/externals/install-winsdk.ps1 @@ -9,7 +9,12 @@ $ErrorActionPreference = 'Stop' # Constants if ($desktopCPP) { - $WindowsSDKOptions = @("OptionId.UWPCpp", "OptionId.DesktopCPPx64", "OptionId.DesktopCPPx86", "OptionID.DesktopCPPARM", "OptionID.DesktopCPPARM64") + $WindowsSDKOptions = @("OptionId.UWPCpp", "OptionId.DesktopCPPx64", "OptionId.DesktopCPPx86", "OptionID.DesktopCPPARM64") + # It appears DesktopCPPARM was removed in SDK 26100 + if ($buildNumber -lt 26100) + { + $WindowsSDKOptions += "OptionID.DesktopCPPARM" + } } else { From 55723b23927ade2d52d95c289d2996fd59a57828 Mon Sep 17 00:00:00 2001 From: Frank Richter Date: Sun, 21 Jul 2024 13:32:23 +0200 Subject: [PATCH 4/4] Extend test workflow with SDK version matrix dimension --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7a160b8..b77a197 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,9 +9,10 @@ jobs: strategy: matrix: os: [windows-latest, windows-2022, windows-2019] + sdkver: [19041, 26100] steps: - uses: actions/checkout@v4 - uses: ./ - uses: ./ with: - winsdk-build-version: 19041 + winsdk-build-version: ${{ matrix.sdkver }}