diff --git a/deploy/build-package.ps1 b/deploy/build-package.ps1 index a0fb481..14273c6 100644 --- a/deploy/build-package.ps1 +++ b/deploy/build-package.ps1 @@ -56,6 +56,21 @@ try { -o $appOut | Out-Null if ($LASTEXITCODE -ne 0) { throw 'dotnet publish failed.' } + # 1b. Trim native SkiaSharp variants the x64 pod never uses. SkiaSharp's net48 + # loader finds the native in either the app root or an arch subfolder (both + # verified), so we keep only the win-x64 libSkiaSharp.dll at the app root and + # drop the x64/x86/arm64 subdir copies and the macOS .dylib (~38 MB). + $rootSkia = Join-Path $appOut 'libSkiaSharp.dll' + if (-not (Test-Path $rootSkia)) { + throw "Expected app\libSkiaSharp.dll (win-x64) before pruning, but it is missing." + } + foreach ($d in 'x64', 'x86', 'arm64') { + $nd = Join-Path $appOut $d + if (Test-Path $nd) { Remove-Item $nd -Recurse -Force } + } + Get-ChildItem $appOut -Filter '*.dylib' -ErrorAction SilentlyContinue | Remove-Item -Force + Get-ChildItem $appOut -Filter '*.so' -ErrorAction SilentlyContinue | Remove-Item -Force + # 2. Bundle the signed ViGEmBus installer into riojoy\vendor. $vendorOut = Join-Path $pkgDir 'vendor' New-Item -ItemType Directory -Force -Path $vendorOut | Out-Null