oliverschwendener / ueli

Cross-Platform Keystroke Launcher
https://ueli.app
MIT License
3.66k stars 242 forks source link

[Bug] No icon for shortcuts of Application Search #1164

Closed pokemaster974 closed 3 months ago

pokemaster974 commented 3 months ago

Describe the bug Using Application Search, all .lnk have a "broken" blank icon.

To Reproduce Steps to reproduce the behavior:

  1. Go to Settings
  2. Enable Application Search into Extension
  3. Modify if needed the settings
  4. See error

Expected behavior Have the app icon like shortcuts in desktop.

Screenshots

Capture d'écran 2024-08-14 094553 Capture d'écran 2024-08-14 094638

Environment

Additional context None

oliverschwendener commented 3 months ago

Are there any logs? Open the settings, go to "Debug" and see if there is anything in "Logs".

pokemaster974 commented 3 months ago

Hi, it seems empty image

Are there other possibilities to have/force a complete debug ?

pokemaster974 commented 3 months ago

Ok, I think I understand why there is no icon. Looking into favorites.json, I saw the location of the icon. An example is :

{
    "executionCount": 2,
    "item": {
        "active": true,
        "description": "C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\Hyper.lnk",
        "executionArgument": "C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\Hyper.lnk",
        "hideMainWindowAfterExecution": true,
        "icon": {
            "parameter": "C:\\Users\\xxx\\.ueli\\application-icons\\hyper-d2d8b7ada6df3f791c26f31189093948.png",
            "type": "URL"
        },
        "id": "search-result-item-1",
        "name": "Hyper",
        "originPluginType": "application-search-plugin",
        "resultNumber": 1,
        "searchable": [
            "Hyper"
        ],
        "supportsOpenLocation": true
    }
},

But I don't have a folder .ueli inot my user folder. I've checked my antivirus and it seems it doesn't delete this folder. I don't know why my folder have disappeared... Do you know how can I try to refresh/recache the icons ?

oliverschwendener commented 3 months ago

The favorites.json file is from ueli v8 and is ignored in v9.

pokemaster974 commented 3 months ago

Ok, so are icons supposed to be cached somewhere or are they directly used from the file ?

It seems this bug is exclusively focused on .lnk, because "direct" apps like Terminal, Courrier, or files like .ahk file correcly display the icons. image

oliverschwendener commented 3 months ago

Ueli tries to extract the icon from the files in the folder you specify in the settings. If it's a .lnk file it tries to extract the icon from the shortcut target (usually a .exe file). Once an app icon was successfully extracted it caches it in %APPDATA%\ueli\FileImageImageGenerator so that on the next rescan it does not have to do the icon extraction again. What happens if you delete all files in %APPDATA%\ueli\FileImageImageGenerator?

oliverschwendener commented 3 months ago

Or try this:

Now the windows file explorer should open the folder containing the application. What icon does show up there?

pokemaster974 commented 3 months ago

Ueli tries to extract the icon from the files in the folder you specify in the settings. If it's a .lnk file it tries to extract the icon from the shortcut target (usually a .exe file). Once an app icon was successfully extracted it caches it in %APPDATA%\ueli\FileImageImageGenerator so that on the next rescan it does not have to do the icon extraction again. What happens if you delete all files in %APPDATA%\ueli\FileImageImageGenerator?

Ok my previous folder contained the icons image But removing it and relaunching (several times) ueli doesn't cache the icons (new FileImageImageGenerator folder remains empty).

pokemaster974 commented 3 months ago

Or try this:

* Select an application that shows the generic file icon, for example Firefox or Wordpad

* Click on "Action" in the bottom right and click on "Show in File Explorer"

Now the windows file explorer should open the folder containing the application. What icon does show up there?

Example taken with Firefox : Shortcut have the correct "app" icon into the Windows Explorer : image

oliverschwendener commented 3 months ago

Can you right click the file in Windows File Explorer and click on "Show file location" or something similar? Where does this shortcut file point to? Is it another shortcut or is it the actual .exe file?

pokemaster974 commented 3 months ago

Can you right click the file in Windows File Explorer and click on "Show file location" or something similar? Where does this shortcut file point to? Is it another shortcut or is it the actual .exe file?

It's the right location (the .exe): image

oliverschwendener commented 3 months ago

image

From this screenshot we can see that Ueli was able to extract the right shortcut icon for Firefox but somehow it does not end up in the search result 🤔

pokemaster974 commented 3 months ago

image

From this screenshot we can see that Ueli was able to extract the right shortcut icon for Firefox but somehow it does not end up in the search result 🤔

Yeah but after manually deleting the folder, I saw that the extraction/cache doesn't work anymore (new folder remains empty)

oliverschwendener commented 3 months ago

Can you open CMD and execute this command and show the output?

where powershell
oliverschwendener commented 3 months ago

How did you install Ueli? From the Windows Store or did you download the installer from GitHub or the website?

pokemaster974 commented 3 months ago

Can you open CMD and execute this command and show the output?

where powershell

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

pokemaster974 commented 3 months ago

How did you install Ueli? From the Windows Store or did you download the installer from GitHub or the website?

From the Github release (not via Windows Store).

oliverschwendener commented 3 months ago

Can you do the following?

pokemaster974 commented 3 months ago

Can you do the following?

* Uninstall Ueli

* Install [v9.0.0](https://github.com/oliverschwendener/ueli/releases/tag/v9.0.0)

* Delete the folder `%APPDATA%\ueli` (note that you will loose all settings, make sure you make a backup of `ueli9.settings.json`)

* Check if it works

So, I've :

Cache folder FileImageImageGenerator remains empty and icons aren't extracted : image

oliverschwendener commented 3 months ago

I want to see the full file path of this shortcut file. Does it end with .lnk or upper case .LNK? Or even something else? That could explain the issue. Can you make another screenshot of the properties of the shortcut file?

image

pokemaster974 commented 3 months ago

Here the screenshot. Tell me if you need more informations. Still on 9.0. image

oliverschwendener commented 3 months ago

Hmm, still no clue what it could be 😅. What if you disable all plugins except Application Search, and set the application search settings to the following:

Application Folders:

File extensions:

pokemaster974 commented 3 months ago

Hmm, still no clue what it could be 😅. What if you disable all plugins except Application Search, and set the application search settings to the following:

Application Folders:

* only add `C:\ProgramData\Microsoft\Windows\Start Menu`

File extensions:

* only add `lnk`

Ok I've done as you recommand me image

And got some errors this time in the Debug tab

pokemaster974 commented 3 months ago

debug.txt

It seems that ueli doesn't give no result with any search (and FileImageImageGenerator stills empty)

oliverschwendener commented 3 months ago

Ok, can you now upgrade to the latest version? The error in this debug log is something that was fixed in v9.0.4. Sorry for the cumbersome debugging process!

pokemaster974 commented 3 months ago

Ok now, it seems to work and folder have icons. image

What is best to trying to debug ? Add parameters into the App search extensions or enabling other extensions ?

pokemaster974 commented 3 months ago

Ok, it seems it's adding "ahk" in the "Add another file extension" which breaks the app. Could you try to add it on your side to see if the bug appears too ?

oliverschwendener commented 3 months ago

Ok weird, I still can't explain why it happened. I suggest enabling other extensions one by one and see if it causes any issues. Then I suggest, if you tweak the application search settings, check after each modification if it caused any issue.

Sorry I didn't see your last message. I'll look into it. Can you quickly explain what a ".ahk" file is?

pokemaster974 commented 3 months ago

~Ok weird, I still can't explain why it happened. I suggest enabling other extensions one by one and see if it causes any issues. Then I suggest, if you tweak the application search settings, check after each modification if it caused any issue.~

Sorry I didn't see your last message. I'll look into it. Can you quickly explain what a ".ahk" file is?

It's a AutoHotkey file (https://github.com/AutoHotkey/AutoHotkey). But the issue is not exclusive to ahk extension settings, and the issue appears with other extensions like py (python) extension file. image image

oliverschwendener commented 3 months ago

Ok, I think I found the issue. The next release should fix this issue. Can you try the latest version? If it's still an issue feel free to reopen.

pokemaster974 commented 3 months ago

Ok, I think I found the issue. The next release should fix this issue. Can you try the latest version? If it's still an issue feel free to reopen.

Tried the 9.3.2. Seems ok. Thanks for the fix !