Skip to content

Make "Open install location" resolve across package managers#4958

Merged
Gabriel Dufresne (GabrielDuf) merged 2 commits into
mainfrom
feat/install-location-resolver
Jun 18, 2026
Merged

Make "Open install location" resolve across package managers#4958
Gabriel Dufresne (GabrielDuf) merged 2 commits into
mainfrom
feat/install-location-resolver

Conversation

@GabrielDuf

Copy link
Copy Markdown
Contributor

This pull request improves the accuracy and robustness of package install location detection across several package managers by enhancing environment variable support, adding fallback mechanisms, and handling multiple installation scenarios. It also introduces advanced logic for resolving MSIX/Store package locations for WinGet, including registry-based lookups and caching for performance.

Enhancements to Install Location Detection:

  • Cargo: Now checks the CARGO_HOME environment variable for the install root, falling back to the user profile if unset.
  • Chocolatey: Resolves the Chocolatey root from the ChocolateyInstall environment variable, with a fallback to the executable's directory, and properly steps out of the bin folder if needed.
  • Flatpak: Checks both system-wide and per-user install locations, returning the first that exists.
  • Homebrew: Adds support for the Linuxbrew prefix and checks both Cellar and Caskroom directories for formulae and casks.
  • Scoop: Honors custom SCOOP and SCOOP_GLOBAL roots, checking both user and global install locations, and returns the first valid path found.
  • Vcpkg: Simplifies the fallback logic and returns null if no valid install location is found.
  • Npm: Clarifies that global modules are installed under %AppData%\npm\node_modules.

Advanced MSIX/Store Package Resolution for WinGet:

  • Adds new methods in WinGetIconsHelper to resolve MSIX/Store package locations by full ID or by fuzzy name matching, using the Windows registry for fast lookups and caching results for performance.
  • Updates WinGet package details helper to utilize these new MSIX resolution methods, prioritizing fast and accurate lookups before falling back to more expensive enumeration.

General Improvements:

  • Improves comments and documentation throughout to clarify logic and intent. (All change references)
  • Adds necessary using directives for threading and string manipulation.

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.

Pull request overview

This PR improves the “Open install location” feature across multiple package managers by making install-folder detection more resilient (env-var aware roots, multiple possible install locations) and adding Windows-specific fallbacks for ARP/MSIX-based installs (including cached registry lookups for WinGet Store/MSIX scenarios).

Changes:

  • Added a Windows ARP (Add/Remove Programs) registry-based fallback for install location resolution, including a WinGet LocalPC encoded-ID fast path.
  • Added MSIX/Store install location resolution for WinGet using registry-backed indexing and caching, with a last-resort fuzzy name match.
  • Improved per-manager install location heuristics (Scoop, Chocolatey, Cargo, Flatpak, Homebrew, Vcpkg, Npm) via env vars, multiple roots, and clearer fallbacks.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/UniGetUI.PackageEngine.PackageManagerClasses/Manager/Helpers/BasePkgDetailsHelper.cs Adds a manager-agnostic ARP registry fallback when a manager-specific install path is missing/invalid.
src/UniGetUI.PackageEngine.PackageManagerClasses/Manager/Helpers/ArpRegistryHelper.cs Introduces ARP registry indexing + TTL caching and encoded-ID resolution to locate install folders on Windows.
src/UniGetUI.PackageEngine.Managers.WinGet/Helpers/WinGetPkgDetailsHelper.cs Uses ARP encoded-ID lookup, MSIX ID lookup, and ARP-by-name before existing path probing; falls back to MSIX enumeration.
src/UniGetUI.PackageEngine.Managers.WinGet/ClientHelpers/WinGetIconsHelper.cs Adds cached registry-backed MSIX location resolution (by encoded ID and fuzzy name matching).
src/UniGetUI.PackageEngine.Managers.Vcpkg/Helpers/VcpkgPkgDetailsHelper.cs Simplifies install-location fallback logic; returns null when no valid path exists.
src/UniGetUI.PackageEngine.Managers.Scoop/Helpers/ScoopPkgDetailsHelper.cs Honors SCOOP/SCOOP_GLOBAL and checks both user and global install roots, returning the first existing path.
src/UniGetUI.PackageEngine.Managers.Npm/Helpers/NpmPkgDetailsHelper.cs Clarifies/corrects global module path construction under %AppData%\npm\node_modules.
src/UniGetUI.PackageEngine.Managers.Homebrew/Helpers/HomebrewPkgDetailsHelper.cs Adds Linuxbrew prefix and checks both Cellar and Caskroom for install locations.
src/UniGetUI.PackageEngine.Managers.Flatpak/Helpers/FlatpakPkgDetailsHelper.cs Checks both system-wide and per-user Flatpak install locations and returns the first existing path.
src/UniGetUI.PackageEngine.Managers.Chocolatey/Helpers/ChocolateyDetailsHelper.cs Resolves Chocolatey root via ChocolateyInstall env var with fallback to executable directory (handling bin shim).
src/UniGetUI.PackageEngine.Managers.Cargo/Helpers/CargoPkgDetailsHelper.cs Uses CARGO_HOME (defaulting to ~/.cargo) to locate the install bin directory.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@GabrielDuf Gabriel Dufresne (GabrielDuf) merged commit d1258c4 into main Jun 18, 2026
3 checks passed
@GabrielDuf Gabriel Dufresne (GabrielDuf) deleted the feat/install-location-resolver branch June 18, 2026 14:19
@GabrielDuf Gabriel Dufresne (GabrielDuf) linked an issue Jun 18, 2026 that may be closed by this pull request
3 tasks
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.

[IMPROVEMENT] Add menu item to "go to install folder"

3 participants