-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Relevant area(s)
WinGet CLI
Description of the new feature / enhancement
For whatever unholy reason, Windows OSs have a strictly enforced max length of 2,047 characters for the PATH environment value. And after installing relatively many portable packages from Winget-pkgs through Winget-cli, this can become something of a problem, as Winget-cli is seemingly (Pressure on "seemingly") able to silently fail to add new filepaths to PATH if the PATH character count has exceeded Windows' 2,047 character limit.
Accordingly, I think that it's time to apply File Explorer's %-type shorthands to the PATH values that Winget-cli generate when having installed a portable program.
Proposed technical implementation details
Make it so that situations where Winget-cli would currently create PATH entries with C:\Program Files (x86)\(...) and C:\Program Files\(...), would instead create ones with %ProgramFiles(x86)%\(...) and %ProgramFiles%\(...) respectively.
This would reduce the increased length of PATH by 3 and 2 characters respectively for each installation.