Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Windows Explorer Integration #29

Open
kojid0 opened this issue Apr 5, 2020 · 7 comments
Open

Windows Explorer Integration #29

kojid0 opened this issue Apr 5, 2020 · 7 comments

Comments

@kojid0
Copy link

kojid0 commented Apr 5, 2020

Please add support for windows explorer integration in order to easily access unlocked cryptomator vaults. Dropbox, Boxcryptor, Nextcloud,... have this feature already and I often use it to navigate quickly between folders.
cryptomator-issue

@overheadhunter overheadhunter transferred this issue from cryptomator/cryptomator Apr 6, 2020
@overheadhunter

This comment has been minimized.

@infeo
Copy link
Member

infeo commented Apr 6, 2020

Currenty this issues contains two feature request, i suggest to open a seperate one for the drive icon and discuss in this one the deeper integration.

Speaking of, what do you mean with explorer integration? Context menu entry? QuickAccess item? Or maybe something else?

@kojid0 kojid0 changed the title Windows Explorer Integration + Drive Icon Windows Explorer Integration (QuickAccess) Apr 6, 2020
@kojid0
Copy link
Author

kojid0 commented Apr 6, 2020

Currenty this issues contains two feature request, i suggest to open a seperate one for the drive icon and discuss in this one the deeper integration.

Speaking of, what do you mean with explorer integration? Context menu entry? QuickAccess item? Or maybe something else?

Alright, I've made separate issues.
I actually meant some other kind of integration on the left panel of windows explorer (see picture). It is not under QuickAccess but separate.
Context menu entry would not make lots of sense, or am I wrong? What could be done with it?

@kojid0 kojid0 changed the title Windows Explorer Integration (QuickAccess) Windows Explorer Integration Apr 6, 2020
@infeo
Copy link
Member

infeo commented Apr 6, 2020

I thought so, but just to be sure. (:

We can use powershell to quickly add and remove an item from the quickaccess:

$o = new-object -com shell.application
$o.Namespace('c:\My Folder').Self.InvokeVerb("pintohome")

@kojid0
Copy link
Author

kojid0 commented Apr 6, 2020

I thought so, but just to be sure. (:

We can use powershell to quickly add and remove an item from the quickaccess:

$o = new-object -com shell.application
$o.Namespace('c:\My Folder').Self.InvokeVerb("pintohome")

I've rechecked and it's not the same as QuickAccess. As you can see in the picture, Boxcrypor, Dropbox,... are not under "Schnellzugriff" (German for QuickAccess). They have separate integration.
You could easily add things to your QuickAccess manually (via context menu) but you cannot add things easily as separate line, e.g. as Boxcryptor, Dropbox are.

@infeo
Copy link
Member

infeo commented Apr 16, 2020

I think this feature-request should be setup during the installation.

We can do it similarly to other cloud providers, Microsoft has documented the steps to follow here: https://docs.microsoft.com/en-us/windows/win32/shell/integrate-cloud-storage

@infeo infeo transferred this issue from cryptomator/dokany-nio-adapter Apr 16, 2020
@lucasschuett
Copy link

lucasschuett commented May 4, 2021

I would really love to see this feature with one of the next releases. Maybe as a checkbox in the mount point menu.
Up to then I have my personal work around which does not require any privileges since it just works with the current user registry. Also it does not contain any steps which require to run during installation.

After I open a vault I run a unique power shell script for each vault. After I close a vault I run another script. Unfortunately I don't have any clue about java, so it is not possible for me to integrate this into the codebase. The steps itself mainly follow the documentation linked by @infeo.

# Tresor Tresorname
# This is a GUID generated by the powershell command New-Guid. After generating it I check with reg query if it already exists in the registry. For the dynamic use in cryptomator the guid should be derived from the upcomming vault id so it is (at least in a way) unique for each vault.
# 01a727bf-86a9-4ebe-a47f-817f3d2f1e11

$meineguid = "01a727bf-86a9-4ebe-a47f-817f3d2f1e11"
"$meineguid"

# I define two variables so that I can adapt this script fast for each of my vaults. $einhaengepfad have to match with the choosen mount point in the cryptomator gui. In the code base of cryptomator this propably is already a variable to hand it over to dokany.

$tresorname = "Tresor"

$einhaengepfad = "%USERPROFILE%\Cryptomator\Tresor"

# The next commands reproduce the documentation of microsoft.
# Name the extension
reg add "HKCU\Software\Classes\CLSID\{$meineguid}" /ve /t REG_SZ /d "$tresorname" /f

# Icon
reg add "HKCU\Software\Classes\CLSID\{$meineguid}\DefaultIcon" /ve /t REG_SZ /d "C:\Program Files\Cryptomator\Cryptomator.ico" /f

# Make extension visible to Navigation Pane
reg add "HKCU\Software\Classes\CLSID\{$meineguid}" /v System.IsPinnedToNameSpaceTree /t REG_DWORD /d 0x1 /f

# Sortorder in Navigation Pane
# If different system folders have to same SortOrderIndex windows sort it by alphabet. 0x42 is the standard value for OneDrive. 0x41 is the standard value for Nextcloud. I want to list my vaults above them.
reg add "HKCU\Software\Classes\CLSID\{$meineguid}" /v SortOrderIndex /t REG_DWORD /d 0x40 /f

# Provide shell dll
reg add "HKCU\Software\Classes\CLSID\{$meineguid}\InProcServer32" /ve /t REG_EXPAND_SZ /d "%systemroot%\system32\shell32.dll" /f

# Define the instance
reg add "HKCU\Software\Classes\CLSID\{$meineguid}\Instance" /v CLSID /t REG_SZ /d "{0E5AAE11-A475-4c5b-AB00-C66DE400274E}" /f

# File system attributes
reg add "HKCU\Software\Classes\CLSID\{$meineguid}\Instance\InitPropertyBag" /v Attributes /t REG_DWORD /d 0x11 /f

# Path to folder
reg add "HKCU\Software\Classes\CLSID\{$meineguid}\Instance\InitPropertyBag" /v TargetFolderPath /t REG_EXPAND_SZ /d "$einhaengepfad" /f

# Shell flags
reg add "HKCU\Software\Classes\CLSID\{$meineguid}\ShellFolder" /v FolderValueFlags /t REG_DWORD /d 0x28 /f

# Shell flags
reg add "HKCU\Software\Classes\CLSID\{$meineguid}\ShellFolder" /v Attributes /t REG_DWORD /d 0xF080004D /f

# Namespace root
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{$meineguid}" /ve /t REG_SZ /d "$tresorname" /f

# Hide from Desktop
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{$meineguid}" /t REG_DWORD /d 0x1 /f

# End

This script ads a system folder for the vault (in this example named Tresor) which refers to $einhaengepunkt. This happens without the need to close and open the explorer.

After closing the vault I run

# Tresor Tresorname
# The GUID have to match the GUID form before.
# 01a727bf-86a9-4ebe-a47f-817f3d2f1e11

$meineguid = "01a727bf-86a9-4ebe-a47f-817f3d2f1e11"
"$meineguid"

# Software class
reg delete "HKCU\Software\Classes\CLSID\{$meineguid}" /f

# Namespace root
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{$meineguid}" /f

# Hide from Desktop
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{$meineguid}" /f

# End

It works fine for me but it would be really nice if Cryptomator does this automatically.
This solution is not as @kojid0 suggested but with small changes (mount vaults in %userprofile%/Cryptomator/Vaultname and let %userprofile%/Cryptomator then be a system folder if a vault is open) his or her suggestion can be realised as well.

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

No branches or pull requests

4 participants