Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove preference for "installed" installer type #4740

Merged
merged 3 commits into from
Aug 20, 2024

Conversation

JohnMcPMS
Copy link
Member

@JohnMcPMS JohnMcPMS commented Aug 19, 2024

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 to UserIntentArchitecture.

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 to Weak for the case of equal installer types.

Microsoft Reviewers: Open in CodeFlow

@JohnMcPMS JohnMcPMS requested a review from a team as a code owner August 19, 2024 18:55
@microsoft-github-policy-service microsoft-github-policy-service bot added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Aug 19, 2024
@JohnMcPMS
Copy link
Member Author

The only issue I uncovered when searching for package versions with installers in the same compatibility set that would be indistinct for upgrades was with multiple versions of ToEverything.AFFiNE (since they added an Nullsoft version of their installer). For example: https://github.com/microsoft/winget-pkgs/blob/master/manifests/t/ToEverything/AFFiNE/0.16.3/ToEverything.AFFiNE.installer.yaml

This is already an issue during upgrade, as for the same reason as the original issue we will prefer exe. With my change, the two x64, user scope installers will be equivalent in priority for upgrade (as they are for install already). We will still choose the exe as it comes first in the list rather than because it matches the detected type of exe.

This isn't really an issue, and it sets the likelihood of needing the UserIntentInstallerType to be implemented to very low.

@JohnMcPMS JohnMcPMS merged commit dc1435a into microsoft:master Aug 20, 2024
9 checks passed
@JohnMcPMS JohnMcPMS deleted the msi-wix branch August 20, 2024 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wix and MSI not considered equal
2 participants