Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mohankumarv2005 opened this issue Apr 24, 2020 · 10 comments
Open

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

mohankumarv2005 opened this issue Apr 24, 2020 · 10 comments

Comments

@mohankumarv2005
Copy link

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?

@mohankumarv2005 mohankumarv2005 changed the title Not able to use icons in Fuse for Shortlinks Not able to use icons in Fuse for Windows Shortcut Apr 24, 2020
@billziss-gh
Copy link
Collaborator

Thanks for the message:

  • I assume by shortcut you mean regular .lnk files.
  • How do you create those shortcuts?
  • Is the shortcut's target also on the file system?

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
Copy link
Author

mohankumarv2005 commented Apr 30, 2020

Thank you for your response.

Here are my answers:-

  • I assume by shortcut you mean regular .lnk files. -> yes
  • How do you create those shortcuts? -> via Windows GUI
  • Is the shortcut's target also on the file system? -> The Shortcut file itself & target program is in Local Disk. Only the icon is in memfs.

Please let me know if you need more details.
image

@billziss-gh
Copy link
Collaborator

billziss-gh commented Apr 30, 2020

@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
Copy link
Author

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
Copy link
Collaborator

@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
Copy link
Collaborator

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
Copy link
Author

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
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants