OpenNingia / Launchy

Launchy is a good looking launcher for Windows

Home Page:http://openningia.github.com/Launchy/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No longer recognizes Citrix Receiver .lnk files (regression since 2.6b2)

nriley opened this issue · comments

I have been trying to use @OpenNingia and @shirosaki's forks of Launchy but both of these no longer include .lnk files generated by Citrix Receiver (shortcuts to remote applications) in their catalog - when I hit F5 to rebuild an index generated by an earlier version, the .lnk files disappear from the catalog.

This seemingly has something to do with the parsing Launchy performs on .lnk files as if I rename it to (for example) .lnq, it is then included in the catalog.

I have tried @shirosaki's latest x64 version, as well as the latest x64 and 32-bit versions from this fork.

I've attached one of these .lnk files in case it is helpful in debugging:

MHSRemote.zip

This is the major version I actually am using Launchy as Windows 10's Start menu search is not as aggressive as Windows 7's.

Thanks for maintaining this app!

This change may be related?
Hash of .lnk file content is used for item equality.
5ab26db

Thanks. So it's possible the new hashing code is doing a worse job than the old one with this .lnk file? It would seem helpful if you could add an assert or log message or something when there's a 0 hash computed if it's going to cause the file to be excluded.

I think that hash = qHash(file.readAll()); is used for your .lnk hash.
If other .lnk files which target is same or same content, only one .lnk file would be included in catalog.

I've added a commit to include file base name for hash calculation.
shirosaki@21c7e89
Please try latest.
I don't know how to add log message for now.

@shirosaki
as always, great work.

About the log message, Launchy has no embedded log viewer, so log message are only useful for developers.

@shirosaki Don't worry about the logging; I was just suggesting in case it was easy (there is always Windows logging for Event Viewer if it becomes necessary in future, or logging to a file on disk). I didn't even think about Launchy using hashing alone to deduplicate (rather than as a first step), but now you explain it makes sense that this might be a way that they're not showing up. Overall this seems very error-prone!

Unfortunately this change to add the name into the hash does not fix anything for me. There are still plenty of .lnk files (which are different) which are not showing up in the catalog. This includes some not generated by Citrix; for example I have some which launch a PowerShell script which also are not showing up. I've attached more than one of these below in a zip file, so you can test to see that they both are added to the catalog - I have 4 of these in the same directory and only one of them shows up, which I guess is because the other ones hash the same and are overwritten in the catalog.

lnk files.zip

Thanks for lnk files.
I found that your lnk files return only exe file path for linkTarget(info.symLinkTarget()).

Shortcut target is:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command . H:\pnagent.ps1; start-pnapplication Hyperspace_SUP
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command . H:\pnagent.ps1; start-pnapplication Hyperspace_BLD

But linkTarget(info.symLinkTarget()) is:

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

So hash of SUP.lnk and BLD.lnk is same.
I've added base name to make different hash key.
shirosaki@95177a7

For debug I've added log output file. (launchy.log is generated in user home directory)
shirosaki@2fc73bc

@shirosaki - Everything works! Both Citrix .lnk files as well as the PowerShell items! Thank you so much!

Here is some log output that confirms the hashes are different:

fullpath: C:/Users/nriley/AppData/Roaming/Microsoft/Internet Explorer/Quick Launch/User Pinned/StartMenu/Hyperspace_BLD.lnk
linkTarget: C:/Program Files (x86)/Citrix/ICA Client/pnagent.exe
baseName: Hyperspace_BLD
hash: -1143788722
fullpath: C:/Users/nriley/AppData/Roaming/Microsoft/Internet Explorer/Quick Launch/User Pinned/StartMenu/Hyperspace_SUP.lnk
linkTarget: C:/Program Files (x86)/Citrix/ICA Client/pnagent.exe
baseName: Hyperspace_SUP
hash: 667261015
fullpath: C:/Users/nriley/Apps/BLD.lnk
linkTarget: C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe
baseName: BLD
hash: 755828211
fullpath: C:/Users/nriley/Apps/SUP.lnk
linkTarget: C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe
baseName: SUP
hash: -1323583766

I've implemented a feature to enable/disable debug log output in advanced dialog option.
shirosaki@24a337f