Remove preference for "installed" installer type #4740
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2565
Change
Move (and rename) the
InstalledTypeComparator
from being a comparator to just a filter. Given what we can (or rather, currently do) actually discern from system state, it doesn't make sense to give preference to the few types that we use to signify the compatibility sets. If we truly want to preserve installer type selection within a compatibility set, we need to store the user selection into the tracking database similar toUserIntentArchitecture
.Validation
Add a test for the case as called out by the issue; regression tests cover it as well and the only one that needed updating was relying on the intentionally changed behavior.
While this change is arguably "correct", it will cause different choices to be made if there are packages with multiple compatible installers that are equal in the other relevant dimensions. I'm working on determining the extent of impact to winget-pkgs via a custom validation pass.
If it turns out to be overly broad, the most likely solution will be to keep the existing behavior but drop from
Strong
toWeak
for the case of equal installer types.Microsoft Reviewers: Open in CodeFlow