Add Ability to Run zwave-js-ui-win as a Windows Service. #3017
-
Tried to install zwave-js-ui-win binary as a service in Windows (in PowerShell: New-Service -Name "z-wave-js-ui" -BinaryPathName c:\z-wave-js-ui\zwave-js-ui-win.exe), but the service won't start. Log Name: System Please add the ability for it run in the background when launched. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 1 reply
-
I sincerly have no clue how this could be done, I don't use windows OS and also the tool I use to create the binary don't allows to create customizations like that. The solution could be to use https://github.com/nospaceships/node-os-service but I dunno how many users are actually using that |
Beta Was this translation helpful? Give feedback.
-
I also couldn't get it to work as a service, when referencing the .exe file directly. However, it does work using nssm. I use this with HA itself. |
Beta Was this translation helpful? Give feedback.
-
I would also like to see this feature. I would guess that there are users with Windows OS and docker option is simply overkill. I'm not sure how you build binaries for Windows, maybe I could help, although I code in C++. |
Beta Was this translation helpful? Give feedback.
-
Sorry but I have other issues with higher priority now and time is so limited, If you wish to send a PR it would be more then welcome |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
@cornellrwilliams Thanks so much for this. Converting this to a discussion |
Beta Was this translation helpful? Give feedback.
I have successfully been able to get ZWaveJSUI to run as a service by using a free third party tool called Non-Sucking Service Manager (NSSM). Once you set it up your service it shows up in the services window and you can control it like any other service. My favorite feature of NSSM is that it also allows you to set an environment variable before the program runs. I have been using the variable PORT=1234 to have each one of my instances run with a different port number so that I can run multiple instances of ZWaveJSUI on my windows machine. I have tested and verified that it works on WIN10, WIN11, and SVR2022. Willing to make a video guide if anyone is interested.