choco
choco copied to clipboard
Record environment changes in pkg info
Related to #563 - record a package's environment changes so on uninstall they are reversed (like PATH additions).
There is a todo comment here about this feature request: https://github.com/chocolatey/choco/blob/develop/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs
Potential concerns for this:
- We don't want to be overzealous; other applications may modify environment variables during a choco install/upgrade. Recording too much of the changes and then reversing them is liable to cause Issues:tm:.
- We should probably separately record things from Install-ChocolateyPath and ensure they're removed if packages don't remove it on their own.
- Is there possibly a way we can monitor processes spawned from choco itself or child processes and filter registry changes based on those processes and what registry access they do? This feels cursed but would be the most complete solution.