Integrate an option to explorer context menu with Electron
This question is not actually related to Electron. It can be divided into two parts:
- Creating custom dynamic context menu entries during installation passing the respective selected file as command line argument to its target
- Node.js command line argument parsing
Creating custom dynamic context menu entries during installation
Windows:
- Adding context menu entries during installation using WiX
- Since it boils down to adding registry keys, this more general SO post about adding context menu entries for specific file types may also interest you.
OSX:
- I really can't tell.
Node.js command line argument parsing
Multiple options exist for command line argument parsing in Node.js, here is just a handful I've been using in the past:
- Minimist
- command-line-args
- and my current favourite, Yargs
For the OS X / macOS case, one (the?) way is to make a service (in ~/Library/Services/
or /System/Library/Services/
) that can receive the folder item(s) in question.
(Footnote 1: Note that services can be individually enabled/disabled in System Preferences, and the whole experience seems a little bit buggy during development sometimes.)
(Footnote 2: I've only done this via the Automator but I hope at least it gives you some pointer as to where to get started.)