fastfetch icon indicating copy to clipboard operation
fastfetch copied to clipboard

[BUG] Winget Detection does not work, however it is still listed in fastfetch -h packages-format

Open cerealdevv opened this issue 5 months ago • 9 comments

Read the FAQ first

  • [x] I have checked the FAQ but the issue is not covered

Description

Winget Detection does not work. this is likely due to winget being overall a very slow package manager.

winget's list command is super slow and outputs unreliable results, you cannot rely on that.

in my fetch, i found a solution, winget looks in these registry keys for its packages: "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall*", "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall*", "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall*" these registry keys seem to be overall more reliable than winget's list command.

note: this includes apps NOT installed through winget directly, however theyre technically installed through winget if they are there note2: while they are not always gotten through winget directly, winget's list command also shows them, and also sometimes has weird formatting.

Version used

fastfetch 2.65.2 (x86_64)

Bug prevalence

Always

Regression

Not sure

Installation

Package manager

Package manager

winget

Screenshots

No response

Configuration


System information

not relevant, winget is not in all.jsonc

Features built-in

threads
vulkan
imagemagick7
chafa
zlib
opencl
libzfs
Embedded wcwidth
WinRT headers
Windows 8.1 Compatibility
Lua 5.5
QuickJS 0.15.1

cerealdevv avatar Jul 02 '26 17:07 cerealdevv

Winget is disabled by default, and can be enabled in config file with

{
    "general": {
        "processingTimeout": 999999
    },
    "modules": [
        {
            "type": "packages",
            "disabled": []
        }
    ]
}

"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall*", "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall*", "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall*"

They contain a lot of garbages. I don't want to change the current logic before I clearly understand how winget handles that.

CarterLi avatar Jul 03 '26 02:07 CarterLi

oh, alright winget does have a lot of unpredictable data and it barely keeps track of what it installs itself vs what it generically found

afterthoughttt avatar Jul 05 '26 00:07 afterthoughttt

while reading through winget documentation stuff, i figured out a way to find a SQLite database which logs installed winget stuff, its in %LOCALAPPDATA\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Microsoft.Winget.Source_8wekyb3d8bbwe\installed.db thats what winget uses when you search winget list --source winget, so that could be what fastfetch would use rather than querying winget directly

afterthoughttt avatar Jul 05 '26 00:07 afterthoughttt

SQL please?

CarterLi avatar Jul 05 '26 01:07 CarterLi

wdym? im not super experienced with SQL stuff, it should be documented since winget-cli is OSS (https://github.com/microsoft/winget-cli/tree/master)

afterthoughttt avatar Jul 05 '26 01:07 afterthoughttt

Hi! I'd like to work on this issue.

I've read through the discussion and understand the concerns about relying on winget list due to its performance and inconsistent output. I also saw the suggestion about using the installed.db SQLite database and the request for more details.

I'm going to investigate the current package detection implementation, inspect the installed.db schema used by Winget, and evaluate whether it can be integrated without introducing unnecessary complexity or dependencies. If the approach looks suitable, I'll share my findings and open a PR.

If someone is already actively working on this issue, please let me know so I don't duplicate the effort.

mannanloomba avatar Jul 28 '26 07:07 mannanloomba

I dont think anyone is working on it.

CarterLi avatar Jul 28 '26 16:07 CarterLi

Is this still being worked upon at all?

RowanSkie avatar Oct 17 '26 10:10 RowanSkie

i don't think so, there's been no commits mentioning it

cerealdevv avatar Oct 18 '26 23:10 cerealdevv