Skip to content

Support environment variable expansion in --location paths #6404

Description

@denelon

Maintainer test — verifying the new agentic Duplicate Surfacing workflow (tracking: #6399). This issue intentionally duplicates an existing request and will be closed shortly after the run completes.

Relevant area(s)

WinGet CLI

Description of the new feature / enhancement

It would be great if the --location argument supported environment variable expansion natively, without relying on the shell. For example, I keep a set of per-app install-location overrides in a frontend and want them to be portable across machines, where the same path resolves differently (different drive letters, user profiles, etc.).

Having winget expand environment variables in --location itself — independent of the calling shell or app — would make those overrides portable.

Proposed technical implementation details

Since / : * ? " < > | are illegal in folder names, a delimiter like <VAR> could denote an environment variable, e.g. --location "<SystemDrive>\Program Files\my-app" would expand <SystemDrive> to C:.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions