Open blakeduffey opened 1 year ago
I'm not sure if there are any arguments that could be passed to the installer to modify its behavior. That would be the first thing I would check.
We're looking into some of the challenges with installers and environment variables as a part of the dependency support work in progress.
Brief description of your issue
I use winget install --id Git.Git as a way to provide users both the git client as well as the updated version of the OpenSSH client. This provides users an updated version of both apps without needing local admin (which our corporate users don't have).
I then add two folders to the local users PATH via
[Environment]::SetEnvironmentVariable("PATH", $Env:PATH + ";$env:LOCALAPPDATA\Programs\Git\bin;$env:LOCALAPPDATA\Programs\Git\usr\bin", [EnvironmentVariableTarget]::User)
This way both git and ssh are in the PATH (and can be run from any directory).
The problem is - when I perform winget upgrade git.git - it clobbers those path entries (and I have to re-add them each time). This seems like something that could be improved?
Steps to reproduce
winget upgrade git.git
Expected behavior
local path changes would be retained
Actual behavior
local path is clobbered
Environment