|
53 | 53 | |
54 | 54 | choco install innosetup -y |
55 | 55 | if ($LASTEXITCODE -ne 0) { exit 1 } |
| 56 | +
|
| 57 | + - name: Detect Windows Kits version (WDF/UMDF headers) |
| 58 | + shell: pwsh |
| 59 | + run: | |
| 60 | + $kitsRoot = Join-Path ${env:ProgramFiles(x86)} "Windows Kits" |
| 61 | + if (-not (Test-Path $kitsRoot)) { |
| 62 | + Write-Error "Windows Kits root not found: $kitsRoot" |
| 63 | + exit 1 |
| 64 | + } |
| 65 | +
|
| 66 | + $includeRoots = |
| 67 | + Get-ChildItem -Path $kitsRoot -Directory | |
| 68 | + ForEach-Object { Join-Path $_.FullName "Include" } | |
| 69 | + Where-Object { Test-Path $_ } |
| 70 | +
|
| 71 | + if (-not $includeRoots -or $includeRoots.Count -eq 0) { |
| 72 | + Write-Error "No Windows Kits Include directories found under: $kitsRoot" |
| 73 | + exit 1 |
| 74 | + } |
| 75 | +
|
| 76 | + $candidates = foreach ($includeRoot in $includeRoots) { |
| 77 | + Get-ChildItem -Path $includeRoot -Directory -ErrorAction SilentlyContinue | |
| 78 | + Where-Object { Test-Path (Join-Path $_.FullName "wdf\umdf\wudfwdm.h") } | |
| 79 | + ForEach-Object { |
| 80 | + [PSCustomObject]@{ |
| 81 | + Version = $_.Name |
| 82 | + IncludeRoot = $includeRoot |
| 83 | + } |
| 84 | + } |
| 85 | + } |
| 86 | +
|
| 87 | + $best = $candidates | Sort-Object -Property Version -Descending | Select-Object -First 1 |
| 88 | + $kitVersion = $best.Version |
| 89 | +
|
| 90 | + if (-not $kitVersion) { |
| 91 | + Write-Error "Could not find any Windows Kits version containing wdf\umdf\wudfwdm.h under: $kitsRoot" |
| 92 | + Write-Output "Discovered Include roots:" |
| 93 | + $includeRoots | ForEach-Object { Write-Output ("- " + $_) } |
| 94 | + exit 1 |
| 95 | + } |
| 96 | +
|
| 97 | + $windowsSdkDir = (Split-Path $best.IncludeRoot -Parent) + "\" |
| 98 | + Write-Output "Using WindowsTargetPlatformVersion: $kitVersion" |
| 99 | + Write-Output "Using WindowsSdkDir: $windowsSdkDir" |
| 100 | + "WINDOWS_TARGET_PLATFORM_VERSION=$kitVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append |
| 101 | + "WINDOWS_SDK_DIR=$windowsSdkDir" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append |
56 | 102 | |
57 | 103 | - name: Setup .NET |
58 | 104 | uses: actions/setup-dotnet@v4 |
|
71 | 117 | $vddSln = "Virtual Display Driver (HDR)/MTTVDD.sln" |
72 | 118 | if (Test-Path $vddSln) { |
73 | 119 | Write-Output "Found VDD solution: $vddSln" |
74 | | - msbuild $vddSln /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=ARM64 /verbosity:minimal |
| 120 | + msbuild $vddSln /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=ARM64 /p:WindowsSdkDir=$env:WINDOWS_SDK_DIR /p:WindowsTargetPlatformVersion=$env:WINDOWS_TARGET_PLATFORM_VERSION /verbosity:minimal |
75 | 121 | if ($LASTEXITCODE -eq 0) { |
76 | 122 | Write-Output "✅ ARM64 VDD build completed successfully" |
77 | 123 | |
@@ -105,7 +151,7 @@ jobs: |
105 | 151 | Write-Output "Building ARM64 VAD with validation disabled..." |
106 | 152 | |
107 | 153 | # Build with validation disabled to avoid x86 tool conflicts with ARM64 outputs |
108 | | - msbuild $vadSln /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=ARM64 /p:EnableInfVerif=false /p:RunApiValidator=false /verbosity:minimal |
| 154 | + msbuild $vadSln /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=ARM64 /p:WindowsSdkDir=$env:WINDOWS_SDK_DIR /p:WindowsTargetPlatformVersion=$env:WINDOWS_TARGET_PLATFORM_VERSION /p:EnableInfVerif=false /p:RunApiValidator=false /verbosity:minimal |
109 | 155 | |
110 | 156 | if ($LASTEXITCODE -eq 0) { |
111 | 157 | Write-Output "✅ ARM64 VAD build completed successfully!" |
@@ -133,7 +179,7 @@ jobs: |
133 | 179 | $vddSln = "Virtual Display Driver (HDR)/MTTVDD.sln" |
134 | 180 | if (Test-Path $vddSln) { |
135 | 181 | Write-Output "Found VDD solution: $vddSln" |
136 | | - msbuild $vddSln /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=x64 /verbosity:minimal |
| 182 | + msbuild $vddSln /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=x64 /p:WindowsSdkDir=$env:WINDOWS_SDK_DIR /p:WindowsTargetPlatformVersion=$env:WINDOWS_TARGET_PLATFORM_VERSION /verbosity:minimal |
137 | 183 | if ($LASTEXITCODE -eq 0) { |
138 | 184 | Write-Output "✅ x64 VDD build completed successfully" |
139 | 185 | |
@@ -162,7 +208,7 @@ jobs: |
162 | 208 | $vadSln = "Virtual-Audio-Driver (Latest Stable)/VirtualAudioDriver.sln" |
163 | 209 | if (Test-Path $vadSln) { |
164 | 210 | Write-Output "Found VAD solution: $vadSln" |
165 | | - msbuild $vadSln /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=x64 /verbosity:minimal |
| 211 | + msbuild $vadSln /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=x64 /p:WindowsSdkDir=$env:WINDOWS_SDK_DIR /p:WindowsTargetPlatformVersion=$env:WINDOWS_TARGET_PLATFORM_VERSION /verbosity:minimal |
166 | 212 | if ($LASTEXITCODE -eq 0) { |
167 | 213 | Write-Output "✅ x64 VAD build completed successfully" |
168 | 214 | |
|
0 commit comments