Skip to content

Find the system WinGet when it is not resolvable through PATH - #5359

Merged
Gabriel Dufresne (GabrielDuf) merged 3 commits into
mainfrom
fix/winget-off-path-discovery
Sep 8, 2026
Merged

Find the system WinGet when it is not resolvable through PATH#5359
Gabriel Dufresne (GabrielDuf) merged 3 commits into
mainfrom
fix/winget-off-path-discovery

Conversation

@GabrielDuf

Copy link
Copy Markdown
Contributor

This pull request introduces a new helper class to robustly locate system-installed WinGet executables, especially those not found on the system PATH, and integrates it into the WinGet manager logic. It also adds comprehensive unit tests to ensure correct behavior in various scenarios, such as prioritization and deduplication of candidate executables.

Enhancements to WinGet executable discovery:

  • Added the SystemWinGetLocator class to encapsulate logic for finding system WinGet executables, including those installed via App Installer and not present on the PATH. This includes registry lookups and parsing of package versions.
  • Updated WinGet.FindCandidateExecutableFiles to accept and use a new delegate for locating off-path system WinGet executables, ensuring these are considered alongside those found on the PATH and bundled versions.

Testing improvements:

  • Added multiple unit tests to cover scenarios such as preferring off-path system WinGet, deduplication when an executable is found both on and off the PATH, and correct handling of different CLI tool preferences. Also tested the parsing and filtering logic in SystemWinGetLocator.
  • Expanded test coverage for CLI tool kind recognition to include App Installer-based WinGet executables.

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.

🟡 Changes recommended

App Installer discovery does not verify the official publisher ID, creating a risk of launching an unrelated executable.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds fallback discovery for system-installed WinGet when unavailable through PATH.

Changes:

  • Discovers WinGet via execution aliases and App Installer registry entries.
  • Integrates off-path candidates with preference-aware deduplication.
  • Adds tests for discovery, ordering, filtering, and version parsing.

Blocking issue: Registry matches must require the official App Installer publisher ID (8wekyb3d8bbwe) to prevent launching an unrelated winget.exe.

File summaries
File Description
src/UniGetUI.PackageEngine.Tests/WinGetManagerTests.cs Tests off-path discovery, candidate handling, and classification.
src/UniGetUI.PackageEngine.Managers.WinGet/WinGet.cs Adds off-path WinGet candidates to executable selection.
src/UniGetUI.PackageEngine.Managers.WinGet/ClientHelpers/SystemWinGetLocator.cs Implements alias and registry-based WinGet discovery.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/UniGetUI.PackageEngine.Managers.WinGet/ClientHelpers/SystemWinGetLocator.cs Outdated

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.

🟢 Approval recommended

The reviewed changes are covered by comprehensive tests, with no unresolved issues.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@randy-but-a-ro randy-but-a-ro Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🤖 Pull request was approved automatically: the AI review is complete and all its review threads are resolved. 🎉

Integration Details
{
	"deliveryId": "26072c20-abc4-11f1-9dd3-78c1fec1ee23",
	"headSha": "3a3ca9af36a4d6f810add5e3248667056f7f4462",
	"reviewer": "copilot-pull-request-reviewer[bot]"
}

@GabrielDuf
Gabriel Dufresne (GabrielDuf) merged commit f49ae07 into main Sep 8, 2026
6 checks passed
@GabrielDuf
Gabriel Dufresne (GabrielDuf) deleted the fix/winget-off-path-discovery branch September 8, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] No package found other then winget in installed packages

2 participants