Skip to content

Support installers that differ only by MinimumOSVersion - #5

Draft
Tom Plant (pl4nty) wants to merge 1 commit into
masterfrom
claude/winget-cli-multi-version-installers-9l3ly2
Draft

Tom Plant (pl4nty) wants to merge 1 commit into
masterfrom
claude/winget-cli-multi-version-installers-9l3ly2

Conversation

@pl4nty

Copy link
Copy Markdown
Member

📖 Description

Manifests can't currently express "use installer/dependencies A on older OS versions and B on newer ones". The motivating case is .NET Framework 3.5: from Windows 11 26H1 (10.0.28000) the NetFx3 Windows feature is gone and apps must depend on the standalone Microsoft.DotNet.Framework.Runtime.3 package instead, while older OS versions still need the feature.

Two bugs blocked this:

  • Validation — installers differing only by MinimumOSVersion were rejected as DuplicateInstallerEntry (key was type/arch/locale/scope). MinOSVersion is now part of the uniqueness key (compared as a version, empty = lowest).
  • Selection — MinOSVersion was only a filter, so when several installers applied the first listed won. Workarounds like using neutral vs x86 arch to dodge the duplicate check made the architecture comparator pick the older installer on 26H1. The OS version filter is now also a comparator: lowest priority, weak, preferring the highest applicable MinOSVersion. Locale/scope/arch/installer-type preferences still win, so existing manifests are unaffected.

🔗 References

🔍 Validation

  • New comparator tests: order independence, inapplicable higher MinOSVersion ignored, architecture still outranks OS version, and a .NET 3.5 test loading a NetFx3 / Microsoft.DotNet.Framework.Runtime.3 manifest and asserting the right dependency set is selected for the current OS.
  • New good/bad uniqueness manifests in ReadGoodManifests / ReadBadManifests.
  • Local build + test run in progress; results will be posted here.

✅ Checklist

🤖 AI Assistance

  • AI assistance was used and has been disclosed in this PR
  • No AI assistance was used

📋 Issue Type

  • Bug fix
  • Feature
  • Task

🤖 Generated with Claude Code

https://claude.ai/code/session_012UP995MPhExEvbvvcjRyR4


Generated by Claude Code

Manifests could not express "use installer/dependencies A on older OS
versions and B on newer ones" (e.g. the NetFx3 Windows feature before
10.0.28000 vs the standalone .NET Framework 3.5 package after):

- Validation rejected installers differing only by MinimumOSVersion as
  DuplicateInstallerEntry. MinOSVersion is now part of the uniqueness key.
- Selection only used MinOSVersion as a filter, so when several installers
  applied the first listed won. The OS version filter is now also a
  (lowest priority, weak) comparator that prefers the installer with the
  highest applicable MinOSVersion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012UP995MPhExEvbvvcjRyR4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants