coreybutler/node-windows

Install Service not working on Windows 8.1 and .NET 4.5

marcofranssen opened this issue ยท 5 comments

I tried following script to run another node package as a service. Opened my nodejs commandprompt as administrator so I have the elevated rights. Nothing is happening. No Service running, no console output, no nothing. Let me know how I can get you more information.

var Service = require('node-windows').Service;

// Create a new service object
var svc = new Service({
    name: 'Subway IRC',
    description: 'IRC client in the browser, running on port 3000',
    script: 'E:\\subway\\subway'
});

// Listen for the "install" event, which indicates the
// process is available as a service.
svc.on('install', function() {
    console.log('Service "%s" installed', svc.name);
    svc.start();
    console.log('Service "%s" started', svc.name);
});

svc.install();

It looks like the exe it ships with requires .NET 2.0. You can install .NET 3.5 (which includes 2.0) to get it to work.

Same issue with windows server data center 2012. It needs .net 2.0 or .net 3.5
I think this should be mentioned as prerequisites in the installation section

Same issue on windows server 2008 r2. The machine has installed .net 4.5 ......

This is a simple winsw configuration issue. WINSW will run fine under .NET 4+ if you supply one extra configuration file. See https://github.com/kohsuke/winsw#net-runtime-40

In my opinion, for simplicity, the extra config file should just always and automatically be generated on install, since there is no real downside to having it (it still works properly in .NET 2.0 environments with or without the file.)

This simplifies node-windows configuration (by not requiring anything extra at all), so it just works out of the box on newer windows systems.

This is the approach I took recently in my fork at https://github.com/arthurblake/node-windows and it's working well for me.

I get this when installing on Windows Server 2012 R2 Datacenter.

image