winfsp / cgofuse

Cross-platform FUSE library for Go - Works on Windows, macOS, Linux, FreeBSD, NetBSD, OpenBSD
https://winfsp.dev
MIT License
511 stars 82 forks source link

Not able to use icons in Fuse for Windows Shortcut #45

Open mohankumarv2005 opened 4 years ago

mohankumarv2005 commented 4 years ago

Hi,

We are trying to create Application Shortcut on Windows where icons being referred from WinFsp Fuse Mounted Drive (memfs). Now, the shortcut is created successfully but the we are not able to see the icon instead a blank icon is shown. However, if we refer to same icon which is in Local Disk it works fine.

Can you please us to understand the issue and a possible workaround?

billziss-gh commented 4 years ago

Thanks for the message:

This works for me with gomemfs for both local and network drives:

Local drive (memfs -o volname=MEMFS y:): Capture

Network drive (memfs -o VolumePrefix=/gomemfs/share,volname=MEMFS y:): Capture2

To make the shortcut I simply dragged and dropped the devenv.exe file into the gomemfs drive, which creates a shortcut

mohankumarv2005 commented 4 years ago

Thank you for your response.

Here are my answers:-

Please let me know if you need more details. image

billziss-gh commented 4 years ago

@mohankumarv2005 it is likely that I misunderstand what you mean. Can you please post a detailed list of steps to make this happen in MEMFS? I cannot reproduce locally.

You may also wish to contact me via private email with more details.

See screenshot of a gomemfs drive started with memfs -ovolname=MEMFS y: and an icon copied into the drive. The icon is displayed correctly.

Capture

If you are looking to change the drive icon itself, Microsoft has instructions here:

https://docs.microsoft.com/en-us/windows/win32/shell/how-to-assign-a-custom-icon-and-label-to-a-drive-letter

mohankumarv2005 commented 4 years ago

Sure, here are the detailed steps: OS: Windows 10 Enterprise

  1. Mount memfs.exe "memfs.exe Y:"
  2. Copy attached Drive.ico.txt icon "Drive.ico" to Y: (Please rename after download)
  3. On Windows Desktop, Right Click and Create a Shortcut with Target as "notepad.exe"
  4. Notice that Shortcut is created in Desktop Successfully with Default Notepad Icon showing.
  5. Right Click on Shortcut -> Properties -> Change Icon -> Point to "Y:\Drive.ico"
  6. Notice that the Shortcut Icon in the Desktop shows Blank.
billziss-gh commented 4 years ago

@mohankumarv2005 thank you for the detailed steps.

When I follow your steps I can confirm that the shortcut ends up with a blank icon as you say. I will investigate further to resolve this problem.

billziss-gh commented 4 years ago

My initial experiments suggest that this works correctly only when the file system name is NTFS.

I was able to make this work by starting memfs like this:

memfs -oExactFileSystemName=NTFS y:

Capture

mohankumarv2005 commented 4 years ago

I am glad you are able to reproduce. But, even after I start memfs.exe with "-oExactFileSystemName=NTFS", the still see the same issue. The icon is still showing blank.

billziss-gh commented 4 years ago

In my experiments earlier I tried with both WinFsp MEMFS and cgofuse MEMFS. Perhaps I observed some weird caching effect from WinFsp MEMFS when I saw this working. I will try it again.

billziss-gh commented 4 years ago

I may have to research this a bit better. This no longer works for me with the icon you posted earlier. However it does work with other icons (e.g. the favicon.ico found in the Windows folder).

(Thankfully the screenshot that I posted earlier serves as proof that I did see it working earlier, because I am beginning to question my own sanity :)

mohankumarv2005 commented 4 years ago

I completely understand. I will wait for your response. Thank you so much for your time.