Fix: pack with --self-contained won't overwrite dupe files from runtime like resources.pri#554
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes a --self-contained packaging bug (issue #548) where runtime files extracted from the Windows App SDK MSIX would overwrite the app's own files in the staging directory — most importantly resources.pri (destroying MRT mappings like Assets\SplashScreen.png → Assets\SplashScreen.scale-200.png) and Assets\StoreLogo.png, causing install failures with 0x80070002. The fix generalizes to skip any runtime file whose destination already exists, preserving app precedence during the runtime bundling step that runs after PRI generation in both single-package and bundle flows.
Changes:
- In
PrepareRuntimeForPackagingAsync, skip the copy when the destination file already exists in staging instead of overwriting it. - Switch
file.CopyTofromoverwrite: truetooverwrite: falseand emit a debug message for each skipped file.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Build Metrics ReportBinary Sizes
Test Results✅ 1190 passed, 1 skipped out of 1191 tests in 514.5s (+4 tests, +86.2s vs. baseline) Test Coverage❌ 17.2% line coverage, 36.3% branch coverage · ✅ no change vs. baseline CLI Startup Time42ms median (x64, Updated 2026-06-01 18:05:09 UTC · commit |
fixes #548
Generalized fix for this issue - any file that has a dupe in the dest directory will not be copied over from the runtime.