Remove the stale bundled-Chocolatey install variable - #5306
Open
Gabriel Dufresne (GabrielDuf) wants to merge 2 commits into
Open
Remove the stale bundled-Chocolatey install variable#5306Gabriel Dufresne (GabrielDuf) wants to merge 2 commits into
Gabriel Dufresne (GabrielDuf) wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds initialization-time cleanup for legacy bundled Chocolatey environment variables.
Changes:
- Detects normalized legacy Chocolatey paths.
- Adds a pre-initialization manager hook.
- Adds path-detection unit tests.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
ChocolateyManagerTests.cs |
Tests legacy-path detection. |
PackageManager.cs |
Adds the pre-initialization hook. |
Chocolatey.cs |
Detects legacy paths and cleans environment variables. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Marc-André Moreau (mamoreau-devolutions)
approved these changes
Aug 20, 2026
Copilot started reviewing on behalf of
Gabriel Dufresne (GabrielDuf)
August 20, 2026 22:55
View session
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 introduces logic to detect and clean up legacy bundled Chocolatey installations, improving the robustness of environment variable handling and initialization. The changes add detection for outdated user environment variables pointing to unsupported Chocolatey paths, ensure these are removed during initialization, and provide comprehensive tests for the new functionality.
Legacy Chocolatey path handling and cleanup:
Chocolatey.cs).ChocolateyInstalluser environment variables if they point to a legacy bundled location, and hooked this into the pre-initialization steps for the Chocolatey manager (Chocolatey.cs)._performPreInitializationStepsmethod in the base manager class and ensured it is called during initialization (PackageManager.cs).Testing improvements:
ChocolateyManagerTests.cs).