Skip to content

save winget curl to user/system PATH #6106

@sagisar1

Description

@sagisar1

Relevant area(s)

WinGet CLI

Description of the new feature / enhancement

Right now, when you upgrade curl for windows through winget (id is cURL.cURL), you have to every time replace the PATH variable on the environment variables to contain the new directory name. For example, if you upgraded from curl 8.18 to 8.19, so the directory where curl.exe will be saved, will be named slightly different due to the version change. So my idea is to automate this during the installation of curl, but this can apply also to other packages as well that the user would like to be saved to his PATH variable (like openssl, ruby, php etc.), instead of doing it manually.

Proposed technical implementation details

An example to a powershell script snippet I wrote that for now do this job for me every time I upgrade curl:

$Old_CURL_Path = ($env:PATH -split ';' | Select-String -Pattern "cURL.cURL").ToString()
$New_CURL_Path = (Get-ChildItem -Path "C:\Users\myusername\AppData" -Filter "curl.exe" -Recurse).DirectoryName
[System.Environment]::SetEnvironmentVariable("PATH", ($env:PATH).Replace($Old_CURL_Path,$New_CURL_Path), [System.EnvironmentVariableTarget]::Machine)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-FeatureThis is a feature request for the Windows Package Manager client.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions