Skip to content

Installing a package doesn't add it it to path #549

Description

@matifali

Brief description of your issue

Installing a package doesn't add it it to path

Steps to reproduce

  1. Install Vim using
    winget install vim
  2. Try to run it using
    vim test.txt

Expected behavior

Vim should open the file if it exist or create a new file.

Actual behavior

Vim : The term 'vim' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At line:1 char:1
+ Vim .\test.txt
+ ~~~
    + CategoryInfo          : ObjectNotFound: (Vim:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Environment

Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19041.450
Package: Microsoft.DesktopAppInstaller v1.10.42241.0
Pinned by denelon

Activity

  1. yigitemres commented on Aug 24, 2020

    @yigitemres

    As I know, winget don't add to PATH automatically. But if the installer itself have ability to add its exe to PATH that means Switches have problem. I'm gonna look at it.


    I'm look at it and vim installer don't have any installer arguments (and there is no installer option to add PATH too). You have to add yourself until this ability comes to winget. There is some feature requests about this issue. It's gonna be added.

    Have a nice day! 🥂

  2. matifali commented on Aug 24, 2020

    @matifali
    Author

    Thanks, I came from linux and is used to installing packages with apt command. So I was expecting the same behaviour with winget.

  3. yigitemres commented on Aug 24, 2020

    @yigitemres

    I think that linux users benefits WSL as a package manager when native gui server comes with it. I use WSLGentoo and when gui server comes with it, I will migrate fully and only use winget in order to contribute it.

  4. mubshrx commented on Aug 25, 2020

    @mubshrx

    Atif Ali (@matifali) winget is still in preview. Hope it will soon grow like apt and other package managers. We have to wait.

  5. denelon commented on Aug 25, 2020

    @denelon
    Collaborator

    I've been working on the backlog recently. You can take a look at the milestones to see what we're planning.

    We do plan on having the ability to add the path for .zip, .exe, and standalone/portable apps. I'm not sure what we'd be able to do with an installer that doesn't provide a path. If we specify a path during "install" time for packages like this, we might be able to add that path to the environment. Is that what you would be looking for here?

  6. mubshrx commented on Aug 25, 2020

    @mubshrx

    Atif Ali (@matifali) this path problem is not because of winget-cli.

    The actual installer of vim does not add vim directory to the path. So this is not an issue of winget-cli.

  7. yigitemres commented on Aug 25, 2020

    @yigitemres

    I've been working on the backlog recently. You can take a look at the milestones to see what we're planning.

    We do plan on having the ability to add the path for .zip, .exe, and standalone/portable apps. I'm not sure what we'd be able to do with an installer that doesn't provide a path. If we specify a path during "install" time for packages like this, we might be able to add that path to the environment. Is that what you would be looking for here?

    Demitrius Nelon (@denelon) I don't know how you gonna handle this but something like this will be good I think:

    1. Determine or override default installer location.
      1. Either pass location: variable as keyword to all manfiests files and install them under "..\winget-pkgs\$pgkname" to easily find winget-pkgs.
      2. Or pass default installer location as location: keyword.
    2. Add shortcut: keyword to manifests.
    3. Add createshortcut: keyword (can be overridden with winget install vim --shortcut y|n )
    4. Run script and add environ vars under winget-shortcuts name with powershell script after each successful installation according to location and shortcuts from manifests. (I don't know how to create environ vars from powershell and I'm too lazy to right now to find it. 😆)

    In the end it turns something like this (example for vim manifest):

    Id: vim.vim
    Name: vim
    AppMoniker: vim
    Version: 8.2.1484
    Publisher: vim
    Author: vim
    License: Copyright (C) 1991-2020 Bram Moolenaar [[email protected]] - Charityware / GNU GPL compatible
    LicenseUrl: https://github.com/vim/vim/blob/master/LICENSE
    MinOSVersion: 10.0.0.0
    Homepage: http://www.vim.org/
    Description: Vim is a highly configurable text editor built to make creating and changing any kind of text very efficient
    Tags: "vim,gvim,vi,text editor,text editing,code editor,utility,tool"
    InstallerType: nullsoft
    Installers:
      - Arch: x64
        Url: https://github.com/vim/vim-win32-installer/releases/download/v8.2.1484/gvim_8.2.1484_x64_signed.exe
        Sha256: 02c7e62b4c712af927d2f0a9635ca7746072feab81b6071a00d95dea2a4ec654
        Switches:
          Silent: /S
          SilentWithProgress: /S
        Location: "C:\Program Files\Vim\vim82" # Default install location.
        Shortcuts: "vim.exe, gvim.exe"
        CreateShortcut: y
    
  8. ghost added
    Needs-TriageIssue needs to be triaged
    on Aug 26, 2020
  9. added
    Issue-FeatureThis is a feature request for the Windows Package Manager client.
    and removed
    Needs-TriageIssue needs to be triaged
    on Aug 26, 2020
  10. modified the milestones: , on Aug 26, 2020
  11. pennstatephil commented on Oct 22, 2020

    @pennstatephil

    Is this essentially a duplicate of #222 ?

  12. 153 remaining items

  13. tunafysh commented on Jul 17, 2025

    @tunafysh

    this might be a bit late but i found out that it works on command prompt and not powershell... it probably has to do with how these shells handle their PATH variables

  14. tunafysh commented on Jul 18, 2025

    @tunafysh

    nvm, fnm was the problem by reading and declaring the path manually instead of using $env:PATH += "path"... fixed it

  15. theJasonHelmick commented on Oct 14, 2025

    @theJasonHelmick

    Hey folks! Thank so much for your help, feedback and patience. We have added the PATH update starting in PowerShell 7.6.0-Preview.5 (https://github.com/PowerShell/PowerShell/releases/tag/v7.6.0-preview.5)

    For more information about this specific update, join us at the next PowerShell community Call on Thursday Oct 16 2025 or watch the recording when convenient. YouTube channel: https://www.youtube.com/channel/UCMhQH-yJlr4_XHkwNunfMog

    Please try out PowerShell 7.6-Preview.5 and let us know what you think - especially if you see any issues. Shortly we will move to Release Candidate ( RC) then General Availability ( GA) for the 7.6.0 Long Term Service (LTS) planned in the Dec/Jan timeframe.

  16. soredake commented on Oct 24, 2025

    @soredake

    Jason Helmick (@theJasonHelmick) will this change be backported to powershell 5.1?

  17. theJasonHelmick commented on Oct 24, 2025

    @theJasonHelmick

    soredake - Thanks for the question! No, Windows PowerShell 5.1 is only serviced for security updates.

  18. denelon commented on Jan 13, 2026

    @denelon
    Collaborator

    Here is a demo in the community call.

  19. ygypt commented on Jan 15, 2026

    @ygypt
  20. Frulfump commented on Jan 15, 2026

    @Frulfump

    Hey folks! Thank so much for your help, feedback and patience. We have added the PATH update starting in PowerShell 7.6.0-Preview.5 (https://github.com/PowerShell/PowerShell/releases/tag/v7.6.0-preview.5)

    For more information about this specific update, join us at the next PowerShell community Call on Thursday Oct 16 2025 or watch the recording when convenient. YouTube channel: https://www.youtube.com/channel/UCMhQH-yJlr4_XHkwNunfMog

    Please try out PowerShell 7.6-Preview.5 and let us know what you think - especially if you see any issues. Shortly we will move to Release Candidate ( RC) then General Availability ( GA) for the 7.6.0 Long Term Service (LTS) planned in the Dec/Jan timeframe.

    7.6.0-preview6 is the latest, any update around expected RC and GA release?

  21. theJasonHelmick commented on Jan 16, 2026

    @theJasonHelmick

    Hi Frulfump. I'm from the PowerShell team and the 7.6 RC is planned for the end of January - with an expectation that it will ga towards the end of febuary. We are quality based, so the final ga date may change based on feedback from the rc. Essentially, my hope is that its in your hands very soon. :)

  22. denelon commented on Mar 26, 2026

    @denelon
    Collaborator

    PowerShell 7.6 is GA!

    Using WinGet to install a package in CMD.exe and in PowerShell 7 now refreshes the environment path variable.

    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-ExternalIssue outside of winget-cli sourceArea-PathIssue related to path environment variableExperimentalThis experimental feature can be enabled in settingsIssue-FeatureThis is a feature request for the Windows Package Manager client.

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions