node-windows icon indicating copy to clipboard operation
node-windows copied to clipboard

Install Service not working on Windows 8.1 and .NET 4.5

Open marcofranssen opened this issue 10 years ago • 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();

marcofranssen avatar Feb 19 '14 08:02 marcofranssen

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.

bwalks avatar Apr 11 '14 00:04 bwalks

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

ekelvin avatar Apr 15 '14 10:04 ekelvin

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

scarletsky avatar Aug 28 '14 06:08 scarletsky

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.

arthurblake avatar Jun 11 '15 12:06 arthurblake

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

image

styfle avatar Jul 19 '16 17:07 styfle