Installer cache in %TEMP%\WinGet accumulates silently with no visibility or built-in cleanup

未關閉
#6,673 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 2 天內回覆

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
35/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
cpp
領域
cli

研究方向

Read the related issue #6623 for context on proposed maintenance commands, then trace the installer cleanup flow around RemoveInstallerFile and how WinGet chooses its temporary cache locations. The issue leaves the command design open; done means users can inspect and safely clean leftover installer files in both listed cache locations.

由索引模型根據 Issue 內容生成。

描述

Issue-Feature
Description of the problem

Problem: WinGet leaves downloaded installer files behind in its temp cache with no built-in way to discover or clean them, and they can accumulate to multiple gigabytes over time.

Real-world example

On this machine:

  • %TEMP%\WinGet accumulated a substantial amount of leftover installer payloads over time (e.g. Chrome/GitKraken/GitHubDesktop/Comet installers plus multiple old versions of uv, Devin CLI, Copilot, pi, etc.).
  • The WinGet cache became a noticeable, non-obvious contributor to Temp disk usage.
  • There is no winget command to show the cache size/location or to purge it, so the only recourse was manual deletion: Remove-Item "$env:TEMP\WinGet\*" -Recurse -Force.
Where installers accumulate
  • %TEMP%\WinGet (default temp location)
  • %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\TempState\WinGet (packaged/App Installer context)
Why they are left behind

Winget removes installers after installation via RemoveInstallerFile, but files can remain when an operation is interrupted, fails hash verification in certain flows, or the process exits unexpectedly. These leftovers are not surfaced to the user and are not cleaned up by any winget maintenance command.

Impact
  • Silent disk-space consumption (easy to miss because it lives under Temp).
  • No visibility: users cannot tell from winget how much space its cached installers occupy or where they are.
  • No safe, supported cleanup path exposed by the tool that produced the files.
Notes

Related: #6623 proposes a bundle of maintenance commands (including clean/cache purge/cache list) as a possible solution. This issue is filed to focus on the underlying problem — leftover installer cache is opaque and unmanageable today — independent of any particular command design.

主要語言
C++
星號
26.6k
分支
1.8k
平均合併
3 天 10 小時
30 天內合併 PR
41

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

microsoft/winget-cli 的其他 Issue

查看 microsoft/winget-cli 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。