Search code examples
node.jsrestelectronshell-namespace-extension

Windows Shell Namespace Extension from REST API


I'm working on a project which is an open-source cloud, similar to Nextcloud. It also provides a file upload and manage feature.

I'd like to have a shell namespace extension which displays those files and folders in the Windows Explorer. Moving, deleting, renaming and editing files / folders should be possible.

Data is available from a REST API or my Electron Client.

I know NodeJS and only some C#.

Is it possible whith NodeJS / Electron to create a shell namespace extension? If not, are there any free libraries which make this task easier?


Solution

  • Windows Explorer uses 'COM' as its extension model. Therefore, technically speaking, you can use whatever you like, as long as it supports COM.

    For NodeJS, you'd be dependent on the runtime to provide the COM support for you and to wrap the appropriate APIs. I'm not aware of any project that does this for the Windows Shell APIs. Here is one for the WinRT APIs.

    For C# (.NET), again you'd be dependent on the runtime for COM support. .NET does expose that to you; although it is messy. There are a few projects which wrap the shell APIs and try to hide the COM interop goo as best they can for you.

    Here is an open source one. Here is a commercial one.

    Be aware that Microsoft advises against building shell extensions which require a runtime (EG: .NET). The runtime may be loaded into processes that aren't expecting it. Therefore, in practice, Microsoft expects you to use C/C++ to build shell extensions. Here is the Microsoft supplied sample project. It is written in C++.