Comments (8)
I took the liberty to rename your issue, I like dedicated issue when possible 😄
Icon is not really a file system feature but a Windows Explorer feature ; maybe we can provide an helper on DokanLibrary yes.
Two ways that I know to change drive icon:
- The hard way: using icon overlay shell extension
- The simple way: changing registry key like
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons\M\DefaultIcon
where M is your dokan drive by setting default value to your icon path for instance
On current OS versions, I don't see any reason to use the hard way as setting registry key do the trick and work well with Dokan drives too.
from dokany.
The icon can be specified in the newly mounted volume FS, please refer to the link below
https://msdn.microsoft.com/en-us/library/windows/desktop/cc144102(v=vs.85).aspx
basically add an icon file and a desktop.ini file to the root of the volume and set the system attribute of both files, I believe the hidden attribute is optional.
[Screen shot of custom icon replacing folder icon]
The following desktop.ini file was used to customize the Music folder, as seen in the preceding illustrations.
[.ShellClassInfo]
ConfirmFileOp=0
NoSharing=1
IconFile=Folder.ico
IconIndex=0
InfoTip=Some sensible information.
From: shlatchz [mailto:[email protected]]
Sent: Monday, August 31, 2015 5:32 PM
To: dokan-dev/dokany [email protected]
Subject: [dokany] Implementing missing features (#51)
Hello,
I was wondering if it's possible to implement missing features, such as InstallIcon() and SetIcon() for changing the disk's icon.
Dokan vs. CBFShttps://www.eldos.com/cbfs/dokan-to-cbfs.php
Thanks!
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/51.
from dokany.
I think the same key exists in HKCU. You can't change values of HKLM if you are not an administrator. Overlay shell is used for other purposes (synced, pending, deleted) like state of a file.
If the software is running only once and the drive is visible to all users the HKLM must be used.
In generally the concept of desktop.ini and autorun.inf should also be ckecked. No permission issues.
from dokany.
I tried adding a value to
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons\M\DefaultIcon
and it works great, but the new icon changes both the icons (1), (2) in the following image, when I want them to be different. I want to configure an icon for (1) and another for (2).
Thanks!
from dokany.
Right, thanks for the additional information everybody.
@shlatchz That's not possible as far as I know. If you visually want a different icon you will only be able to do that on the same ico file based on the different embedded sizes.
from dokany.
It worked! Thanks 👍
from dokany.
This feature request is valid 👍
But the Dokan team have other issues to manage for now.
So if someone have a great ❤️ to propose a pull request.
I would be happy to review it personally !
from dokany.
I was just trying to do this, I set the file attributes to FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN
and this is my autorun.inf file:
[Autorun]
icon=autorun.ico
But for some reason it does not show that icon, even though the file on the drive shows it as a thumbnail.
When I copy the icon off the Dokan drive it has the same hash as the source file, so I do not think that would be the problem.
On the same machine, mounting the Windows 10 ISO does show the custom icon that it has in autorun.inf, the only difference I see is the way they are mounted and the fact that the Windows ISO is using an EXE for the icon.
from dokany.
Related Issues (20)
- There is no certificate in dokan2.sys for version 2.1.0.1000. HOT 2
- Error Installing version 2.1.0.1000 HOT 17
- Error Uninstalling Dokan Library 1.5.1.1000 Bundle (0x80070643) HOT 3
- Possibility to increase thread count & change DOKAN_OPTION_ALLOW_IPC_BATCHING? (FUSE) HOT 14
- some doubts in dokanfuse HOT 2
- 2.1.0.1000 on Windows 11 hangs Windows Explorer in single thread mode HOT 2
- Stdout not working anymore after fuse_main invocation HOT 2
- `DokanInstanceBuilder.Build` returns before file system is ready HOT 1
- Compatibility with Rising antivirus software HOT 8
- unstable on windews : ceph::buffer::v15_2_0::bad_alloc: Bad allocation [buffer:1] HOT 1
- GetFileInformation Not Called by FileDateTime in VB6 HOT 2
- When is ReadFile() called? HOT 1
- There are some errors when test memfs with winfstest HOT 2
- Dokan2 driver fails to install on Windows 10 HOT 2
- Library - Fail mount with DOKAN_OPTION_CURRENT_SESSION and mount point path
- Install fails on Win11 - Paralles on Mac M1 HOT 5
- Help | How to implement save in dokan HOT 13
- Cannot uninstall Dokan Library - Blocked by pending restart stuck state. HOT 9
- Installer says Dokan 2.1.0.1000 is installed, but it isn't
- dokan limit speed, but windows10 pop-up never displays progress
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dokany.