microsoft / microsoft/winget-cli

Updating portable package removes its PATH entry

Open
#6,461 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Command-Upgrade Issue-Bug Possible-Duplicate
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

Relevant area(s)

WinGet CLI

Relevant command(s)

winget upgrade

Brief description of your issue

This affects at least portable packages. I have noticed it for Anthropic.ClaudeCode package.
Once it's installed for the first time everything is fine. The %APPDATALOCAL%\Microsoft\WinGet\Packages\Microsoft.Sysinternals.Suite_Microsoft.Winget.Source_8wekyb3d8bbwegets is added to PATH correctly. The problem occurs when the package is upgraded to a newer version. Once it's done the PATH entry gets removed and claude is not recognized anywhere.

Steps to reproduce

Consider these steps to reproduce as a suggestion. I tried a sequence of uninstall, installing a specific version, then upgrading to the latest one but the bug does not occur. I suppose something different causes it to happen or it's just a random one (strange).

  1. winget install Anthropic.ClaudeCode - notice the PATH entry is correct
  2. Wait for the update
  3. sudo winget upgrade --all (I suppose any other method also works but this is how I usually run it) - Now the PATH entry gets removed
Expected behavior

The PATH entry should be retained or updated if needed.

Actual behavior

PATH entry for claude sometimes gets removed

Environment
Windows Package Manager v1.29.280
© 2026 Microsoft. All rights reserved.

Windows: Windows.Desktop v10.0.26200.8893
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.29.280.0

WinGet Directories
------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState…
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState…
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User)       %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root              C:\Program Files\WinGet\Packages
Portable Package Root (x86)        C:\Program Files (x86)\WinGet\Packages
Installer Downloads                %USERPROFILE%\Downloads
Configuration Modules              %LOCALAPPDATA%\Microsoft\WinGet\Configuration\Modules

Links
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled
ProxyCommandLineOptions                   Disabled
ConfigurationProcessorPath                Disabled
DefaultProxy                              Disabled

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the winget install and winget upgrade --all paths for portable packages, using the reported Anthropic.ClaudeCode case and the WinGet directories listed in the environment. Investigate how the upgrade handles the Portable Links and PATH entries; done means upgrading the package no longer removes the existing entry and the claude command remains recognized.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.