Steveorevo / node-maker

A set of subflows that can be used to quickly create a new Node-RED node, its property panels, and initial behavior.
GNU Lesser General Public License v2.1
21 stars 4 forks source link

Support on Windows #1

Open Steveorevo opened 2 years ago

Steveorevo commented 2 years ago

Node Maker does not currently run under windows due to file path differences and commands. Currently there are two issues:

The command to restart node-red relies on starting node-red from the CLI and writing a PID (process id) file to a temp folder. When invoking Node Maker, it should execute a command to restart node-red by terminating the prior process by PID and then restarting node-red (updating the PID file in the temp folder).

Research

The "Windows" way to do this would be to invoke PowerShell from cmd via a command like:

powershell.exe -Command "(Start-Process -FilePath node-red -PassThru -WindowStyle Hidden).Id"

This runs node-red in a hidden window and returns the process id. We can then use taskkill to end the process:

taskkill /F /PID

Implementing this could be possible; and we'd gain Windows support.