File tree Expand file tree Collapse file tree 1 file changed +25
-4
lines changed
Expand file tree Collapse file tree 1 file changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -62,10 +62,31 @@ jobs:
6262 shell : pwsh
6363 run : New-Item -ItemType Directory -Force -Path "${{ env.BUNDLE_DIRECTORY }}" | Out-Null
6464
65- - name : Setup Windows SDK (adds MakeAppx.exe to PATH)
66- uses : microsoft/setup-windows10-sdk@v1
67- with :
68- sdk-version : 10.0.22621.0
65+ - name : Add Windows SDK MakeAppx.exe to PATH
66+ shell : pwsh
67+ run : |
68+ $kitsRoot = 'C:\Program Files (x86)\Windows Kits\10\bin'
69+ if (-not (Test-Path $kitsRoot)) { throw "Windows 10 SDK not found at $kitsRoot" }
70+
71+ $latest = Get-ChildItem $kitsRoot -Directory |
72+ Where-Object { $_.Name -match '^\d+\.\d+\.\d+\.\d+$' } |
73+ Sort-Object { [version]$_.Name } -Descending |
74+ Select-Object -First 1
75+
76+ if (-not $latest) { throw "No versioned SDK bin folders under $kitsRoot" }
77+
78+ $sdkBinX64 = Join-Path $latest.FullName 'x64'
79+ if (-not (Test-Path (Join-Path $sdkBinX64 'makeappx.exe'))) {
80+ # Fallback to non-versioned x64 bin if present
81+ $sdkBinX64 = Join-Path $kitsRoot 'x64'
82+ }
83+ if (-not (Test-Path (Join-Path $sdkBinX64 'makeappx.exe'))) {
84+ throw "makeappx.exe not found in $sdkBinX64"
85+ }
86+
87+ $sdkBinX64 | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
88+ Write-Host "Using SDK bin: $sdkBinX64"
89+ Get-Command makeappx.exe
6990
7091 - name : Make msixbundle
7192 id : bundler
You can’t perform that action at this time.
0 commit comments