Honor explicit per-package install location on WinGet update#5173
Merged
Gabriel Dufresne (GabrielDuf) merged 3 commits intoJul 22, 2026
Merged
Conversation
Resolves conflict in WinGetPkgOperationHelper: main extracted the update install-location logic into GetEffectiveUpdateLocation(). Ported the #5164 explicit-per-package rule (honor CustomInstallLocationIsExplicit, keep the manager-wide default gated behind WinGetForceLocationOnUpdate for #4210) into that helper. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot started reviewing on behalf of
Gabriel Dufresne (GabrielDuf)
July 22, 2026 15:51
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Tracks whether install locations are package-specific so WinGet updates can distinguish them from manager defaults.
Changes:
- Adds and propagates an explicit-location marker.
- Updates WinGet location resolution.
- Adds factory-level tests.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
InstallOptionsFactoryTests.cs |
Tests location provenance. |
InstallOptions.cs |
Adds and copies the transient marker. |
InstallOptionsFactory.cs |
Determines location provenance. |
WinGetPkgOperationHelper.cs |
Applies explicit locations during updates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Marc-André Moreau (mamoreau-devolutions)
approved these changes
Jul 22, 2026
3 tasks
3 tasks
3 tasks
Gabriel Dufresne (GabrielDuf)
deleted the
fix/5164-custom-location-ignored-on-update
branch
July 22, 2026 18:03
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request improves how custom install locations are handled for package installations and updates, ensuring that only explicitly set per-package locations are always honored, while manager-wide defaults remain opt-in for updates. The main changes introduce a new property to track whether a custom location was set explicitly for a package, and update the logic and tests accordingly.
Custom Install Location Handling:
CustomInstallLocationIsExplicitproperty to theInstallOptionsclass to indicate if a location was set explicitly for a package rather than inherited from a manager-wide default. This property is transient and not serialized.InstallOptions.Copy()method to ensure the newCustomInstallLocationIsExplicitproperty is copied correctly.Install Options Factory Logic:
InstallOptionsFactory.LoadApplicableto setCustomInstallLocationIsExplicitbased on whether the location was explicitly set for the package (OverridesNextLevelOpts).WinGet Package Operation Logic:
WinGetPkgOperationHelper.csso that on updates, only explicit per-package install locations are always honored; inherited manager-wide defaults require the opt-in setting as before. This prevents unintended relocation of existing installs.Testing:
InstallOptionsFactoryTeststo verify thatCustomInstallLocationIsExplicitis correctly set for explicit per-package overrides and not for inherited manager defaults.