Find the system WinGet when it is not resolvable through PATH - #5359
Conversation
There was a problem hiding this comment.
🟡 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.
There was a problem hiding this comment.
🤖 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]"
}
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:
SystemWinGetLocatorclass to encapsulate logic for finding system WinGet executables, including those installed via App Installer and not present on thePATH. This includes registry lookups and parsing of package versions.WinGet.FindCandidateExecutableFilesto accept and use a new delegate for locating off-path system WinGet executables, ensuring these are considered alongside those found on thePATHand bundled versions.Testing improvements:
PATH, and correct handling of different CLI tool preferences. Also tested the parsing and filtering logic inSystemWinGetLocator.