Skip to content

Commit df0a86a

Browse files
committed
Bump nssm binaries to version 2.21
1 parent 148b792 commit df0a86a

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

Diff for: .gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules/*
22
winser*tgz
3-
npm-debug.log
3+
npm-debug.log
4+
.DS_Store

Diff for: bin/nssm.exe

56.5 KB
Binary file not shown.

Diff for: bin/nssm64.exe

60.5 KB
Binary file not shown.

Diff for: bin/winser

+18-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ String.prototype.supplant = function (o) {
1717

1818
program
1919
.version(require("../package.json").version)
20+
.option("-a, --autostart", "start the application immediately after installation")
2021
.option("-i, --install", "install the node application as a windows service")
2122
.option("-r, --remove", "remove the windows service for the node application")
2223
.option("-x, --stop", "stop the service before uninstalling")
@@ -107,7 +108,7 @@ sequence
107108
}else{
108109
log("The program {serviceName} was installed as a service.".supplant({serviceName: appName}));
109110
}
110-
next();
111+
next(nssmExe);
111112
});
112113
}else if(program.remove){
113114
exec("\"{binfolder}\\{nssmExe}\" remove {serviceName} confirm".supplant({
@@ -123,4 +124,20 @@ sequence
123124
next();
124125
});
125126
}
127+
})
128+
.then(function(next, err, nssmExe){
129+
if(program.autostart){
130+
exec('\"{binfolder}\\{nssmExe}\" start {serviceName}'.supplant({
131+
binfolder: __dirname,
132+
serviceName: appName,
133+
nssmExe: nssmExe,
134+
}), function(err,stdout, stderr){
135+
if(stderr){
136+
!program.silent && console.error(stderr);
137+
}else{
138+
log("The program {serviceName} was started successfully.".supplant({serviceName: appName}));
139+
}
140+
next(nssmExe);
141+
});
142+
}
126143
});

0 commit comments

Comments
 (0)