Dependencies for node-windows services

266 Views Asked by At

I'm wondering how to define dependencies (other non node-windows nor node.js windows services).

In the code of winsw (HERE) I've found out it should be possible.

For me it seems to be a "issue" in node-windows as winsw can do it by adding following code to the service .xml file:

<depend>Eventlog</depend>
1

There are 1 best solutions below

3
Dani On

I think I got it, it's implemented but not documented (at least I didn't found it): https://github.com/coreybutler/node-windows/blob/master/lib/winsw.js#L25 https://github.com/coreybutler/node-windows/blob/master/lib/winsw.js#L110

That brought me to the following (example) code:

var svc = new Service({
  //...,
  dependencies: [
    'EventLog',
    'W32Time'
  ]
});