Closed serg-repin closed 6 years ago
One trivial way to do this is to always pass a parameter when invoking the script as an application. With node-windows
there is no way to pass any parameters to the script, since it's lifecycle is managed by a wrapper. So if that parameter is undefined
inside the script, then you know that the script is running as a service.
Not sure if this would suffice; if not, please describe your use case in more detail.
I have trouble with service/console identification. Maby I can set some arguments when call Service. Then I can find this argument and understand - it is service, or not. A have tryed with 'nodeOptions', but fail. Сan I do this?