KEMBAR78
Better DefaultInstallVersion by yao-msft · Pull Request #5389 · microsoft/winget-cli · GitHub
Skip to content

Conversation

yao-msft
Copy link
Contributor

@yao-msft yao-msft commented Apr 16, 2025

DefaultInstallVersion being null causes larger than expected issues. The change proposes to return latest applicable version if exists, to minimize duplicate installs/ upgrade failures. If no latest applicable version, return latest available version if exists.

Microsoft Reviewers: Open in CodeFlow

@yao-msft yao-msft requested a review from a team as a code owner April 16, 2025 00:08
return m_defaultInstallVersion;
InitializeLatestApplicableVersion();

if (m_latestApplicableVersion)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If people absolutely do not want applicability check for DefaultInstallVersion, I can remove this if statement. But I feel having applicability check will lower chances of upgrade failures.

}
else if (AvailableVersions().Size() > 0)
{
return GetPackageVersionInfo(AvailableVersions().GetAt(0));
Copy link
Member

Choose a reason for hiding this comment

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

I would rather that this decision be made in the call_once, but I also refactored this entire function elsewhere in my upcoming PR. So I will move that when I handle the merge conflict that this creates...

@yao-msft yao-msft merged commit 3efea38 into microsoft:master Apr 16, 2025
9 checks passed
@yao-msft yao-msft deleted the olddefaultversion branch April 16, 2025 18:07
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.

CatalogPackage.DefaultInstallVersion is null for most packages on WinGet 1.11.200-preview

2 participants