1

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>
Dani
  • 41
  • 4

1 Answers1

0

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'
  ]
});
Dani
  • 41
  • 4
  • I know this question is a few years old, but I tried this approach on my system, and I couldn't get it to work. When I look at the xml file, the `` tag never appears. – Prdufresne Sep 26 '22 at 18:06
  • If I remember correctly, for me it actually worked. Of course this info alone will not help you, but I'm not sure how else I could help. Would you like to share some informations? Or some other way I can maybe help? @Prdufresne – Dani Sep 27 '22 at 16:59
  • 1
    I used the same syntax, but the xml file never included the tags so the service, when created, never gets the dependency. When I look at the node-windows source code, it looks like it should work, I'm just not seeing it. I think I should open a ticket in the node-windows github. – Prdufresne Sep 27 '22 at 19:10