Skip to content

MSIX: Always include PackageIntegrity/Content[Enforcement=on] - #611

Merged
Nikola Metulev (nmetulev) merged 4 commits into
mainfrom
user/drustheaxe/msix-packageintegrity
Jul 12, 2026
Merged

Nikola Metulev (nmetulev) merged 4 commits into
mainfrom
user/drustheaxe/msix-packageintegrity

Conversation

@DrusTheAxe

@DrusTheAxe Howard Kapustein (DrusTheAxe) commented Jul 10, 2026 •

Copy link
Copy Markdown
Member

All appxmanifest.xml should include

<uap10:PackageIntegrity><uap10:Content Enforcement="on"/>

uap10:Content - Windows UWP applications | Microsoft Learn

Store-signed packages received a degree of additional protection since Win8 -- pkgdir lockdown (TrustLevel ACE, etc), some pkgdir / blockmap verifications at activation, etc.

This was later (20H1 aka 10.0.19041.0) extended to other signed packages, if they opt-in via <uap10:PackageIntegrity>.

This manifest option is ignored if not relevant (e.g. the package isn't signed).

NOTE: Enforcement options are on, off, and default (ie Windows decides, currently equivalent to off). While Windows could change the default behavior to on, that wouldn't help for existing downlevel Windows systems. So always specifying it in the manifest is the right answer, until if/when Windows treats default equivalent to on, and is ubiquitous across the ecosystem (IOW, a loooong way into the future, at best).

Copilot AI review requested due to automatic review settings July 10, 2026 19:44
@DrusTheAxe

Copy link
Copy Markdown
Member Author

/azp run

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds package content-integrity enforcement to shipped, generated, sample, and test MSIX manifests.

Changes:

  • Enables uap10:Content Enforcement="on".
  • Adds required uap10 namespace declarations.
  • Updates manifest fixtures and samples consistently.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/winapp-VSC/src/test/fixtures/winui-gallery.appxmanifest Enables integrity enforcement.
src/winapp-VSC/src/test/fixtures/widgets-sample.appxmanifest Enables enforcement; duplicates a namespace declaration.
src/winapp-VSC/src/test/fixtures/push-notifications-sample.appxmanifest Enables integrity enforcement.
src/winapp-VSC/src/test/fixtures/edge-cases.appxmanifest Enables integrity enforcement.
src/winapp-VSC/src/test/fixtures/background-task-sample.appxmanifest Enables enforcement; duplicates a namespace declaration.
src/winapp-CLI/WinApp.Cli/Templates/appxmanifest.sparse.xml Secures generated sparse manifests.
src/winapp-CLI/WinApp.Cli/Templates/appxmanifest.packaged.xml Secures generated packaged manifests.
src/winapp-CLI/WinApp.Cli.Tests/TestApps/winui-crash-app/Package.appxmanifest Updates test-app manifest.
src/winapp-CLI/WinApp.Cli.Tests/TestApps/cpp-winui-crash-app/appxmanifest.xml Updates test-app manifest.
samples/wpf-app/appxmanifest.xml Updates WPF sample manifest.
samples/winui-app/Package.appxmanifest Adds enforcement but omits downlevel namespace handling.
samples/tauri-app/appxmanifest.xml Updates Tauri sample manifest.
samples/rust-app/appxmanifest.xml Updates Rust sample manifest.
samples/flutter-app/appxmanifest.xml Updates Flutter sample manifest.
samples/electron/appxmanifest.xml Updates Electron sample manifest.
samples/electron-winml/appxmanifest.xml Updates Electron WinML manifest.
samples/dotnet-app/appxmanifest.xml Updates .NET sample manifest.
samples/cpp-app/appxmanifest.xml Updates C++ sample manifest.
samples/cpp-app-winui/appxmanifest.xml Updates C++ WinUI manifest.
msix/appxmanifest.xml Secures the CLI’s MSIX manifest.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread samples/winui-app/Package.appxmanifest Resolved
@github-actions

github-actions Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Build Metrics Report

Binary Sizes

Artifact Baseline Current Delta
CLI (ARM64) 31.87 MB 31.87 MB 📈 +0.5 KB (+0.00%)
CLI (x64) 32.19 MB 32.19 MB 📈 +0.5 KB (+0.00%)
MSIX (ARM64) 13.39 MB 13.39 MB 📈 +0.3 KB (+0.00%)
MSIX (x64) 14.22 MB 14.22 MB 📉 -0.1 KB (-0.00%)
NPM Package 27.91 MB 27.91 MB 📈 +0.7 KB (+0.00%)
NuGet Package 27.94 MB 27.94 MB 📈 +0.7 KB (+0.00%)

Test Results

✅ 1611 passed, 1 skipped out of 1612 tests in 361.5s (-61.0s vs. baseline)

Test Coverage

❌ 18.3% line coverage, 37.4% branch coverage · ✅ no change vs. baseline

CLI Startup Time

35ms median (x64, winapp --version) · ✅ -9ms vs. baseline


Updated 2026-07-11 04:59:02 UTC · commit 03017bc · workflow run

@nmetulev Nikola Metulev (nmetulev) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI-generated review — not a human sign-off

Generated by GitHub Copilot CLI (Claude Opus 4.8) using this repo's pr-review skill: an 8-dimension parallel review (security, correctness, CLI UX, alternative-solution, test-coverage, docs, packaging), a GPT-5.5 cross-check, and real tool testing with the Windows SDK makeappx.exe 10.0.26100 and the VS Code extension's pinned @xmldom/xmldom 0.9.x. Please verify each item before acting — this is automated analysis, not an approval.

Summary: 0 critical · 4 high · 3 medium · 1 low

Must-fix (high)

  • Duplicate xmlns:uap10 → malformed XML in background-task-sample.appxmanifest and widgets-sample.appxmanifest. Line 3 of each already declares xmlns:uap10 (on the long single-line <Package …> the diff doesn't show), and this PR adds a second one. Verified for real: @xmldom/xmldom 0.9.x (the extension's parser) throws Attribute xmlns:uap10 redefined, and .NET rejects it too — breaking manifest-parser.test.ts (parses every fixture) and background-task-fixture.spec.ts. See inline comments. (A scan of all 20 changed manifests found only these two affected.)
  • samples/winui-app/Package.appxmanifest adds uap10:PackageIntegrity but leaves IgnorableNamespaces="uap rescap" while MinVersion="10.0.17763.0". See inline comment.
  • E2E breakage — src/winapp-VSC/src/test/e2e/properties-tab.spec.ts:169-182 (not in this diff, noted here): the test can add Package Integrity Content Enforcement expects the add-button visible and value default, but its fixture winui-gallery.appxmanifest (via shared-context.ts) now already contains <uap10:Content Enforcement="on"/>. Update the test, or reset to a PackageIntegrity-free fixture.

Medium / low (not on changed lines)

  • Packaging (medium): cpp-app, cpp-app-winui, electron, electron-winml, wpf-app, tauri-app use non-ignorable uap10 (needed for TrustLevel) with MinVersion="10.0.18362.0"; the new 19041-only PackageIntegrity element is then unknown and non-ignorable on builds 18362–19040. Decide a min-OS policy or confirm downlevel tolerance. (Not tested on a downlevel image — medium confidence.) See inline comment on cpp-app.
  • Test coverage (medium): nothing locks the new guarantee. Add assertions that the generated packaged/sparse templates and the updated fixtures contain PackageIntegrity / Enforcement="on" (ManifestCommandTests.cs, manifest-parser.test.ts).
  • Alternative solution (medium): the PR title says "all new MSIX packages," but only static templates/samples are edited — user-supplied manifests passed to winapp package won't get it. Consider a central AppxManifestDocument.EnsurePackageIntegrityContentEnforcement("on") invoked from MsixService.UpdateAppxManifestContentAsync (mirrors the existing VSC applyPackageIntegrityEnforcement).
  • Docs (low): the always-on default is undocumented — add a note to docs/fragments/skills/winapp-cli/manifest.md explaining what PackageIntegrity does and how to disable it.

Checked and cleared (via real testing)

  • Element ordering is not a problem. makeappx packed both templates cleanly, packed a negative control with PackageIntegrity deliberately placed before <DisplayName> (exit 0), and rejected Enforcement="bogusValue" (violates enumeration constraint of 'default on off'). So Properties is order-insensitive and Enforcement="on" is valid.
  • The shipped packaged/sparse templates are fine — they correctly mark uap10 ignorable, so MinVersion=18362 is not a blocker there.

Comment thread samples/winui-app/Package.appxmanifest Resolved
Comment thread samples/cpp-app/appxmanifest.xml Resolved
@DrusTheAxe

Copy link
Copy Markdown
Member Author

/azp run

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.

Resolve conflicts from #615 (VS Code extension removed from repo): the
5 modified src/winapp-VSC/src/test/fixtures/*.appxmanifest files were
deleted on main, so accept the deletion. PackageIntegrity additions to
the surviving samples, CLI templates, and CLI test-app manifests are
retained.

Co-authored-by: Copilot App <[email protected]>
@nmetulev
Nikola Metulev (nmetulev) enabled auto-merge (squash) July 11, 2026 04:44
@nmetulev
Nikola Metulev (nmetulev) merged commit c8b1d62 into main Jul 12, 2026
22 checks passed
@nmetulev
Nikola Metulev (nmetulev) deleted the user/drustheaxe/msix-packageintegrity branch July 12, 2026 01:48
Nikola Metulev (nmetulev) added a commit that referenced this pull request Jul 12, 2026
Resolve the DIRTY PR state after winui-devex advanced (DevTools specs,
XamlTriage/stowed-exception work, #611 MSIX PackageIntegrity). All files
auto-merged cleanly except the two generated setup SKILL.md mirrors, whose
option tables were regenerated on both sides.

Resolved both conflicts as the schema-accurate union: keep the project-mode
rows added by this PR (--configuration, --property, --runtime) and take the
base's updated --debug-output / --symbols descriptions (WinUI stowed-exception
triage). Verified the resolution matches fresh generation:
- docs/cli-schema.json is byte-identical to a fresh --cli-schema dump
  (version field aside), so validate-docs' schema compare passes.
- .github/plugin setup SKILL.md is byte-identical to a fresh generate-llm-docs
  render, and scripts/sync-claude-plugin.ps1 -Check reports ".claude/ is up to
  date."

Folder mode remains byte-identical; no CLI-surface change. Debug !~E2E_Node
suite: 1759 passed / 0 failed / 2 pre-existing env-skips.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: b05ed756-966d-4260-a593-f507c4cb2446
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants