I have an application installer in node-js platform, currently developing an installer with Inno Setup and NSSM (The application should run as a service).
The thing is when NSSM tries to register the service (The device is a Windows 8.1 32 bits Enterprise running over a tablet PC), NSSM fails with Exit code 5.
I couldn't find anything more usefull than access denied and no help in the matter. Tried a lot of stuff, like changing the folders, the names, the users, every time, it fails.
Inno script looks like this:
; Add System Service Filename: "{app}\{#NSSM}";
Parameters: "install {#MyAppShortName} {app}\winstart-server.bat";
Flags: runhidden runascurrentuser;
Filename: "{app}\{#NSSM}";
Parameters: "set {#MyAppShortName} AppStdin {app}\{#MyAppShortName}.log";
Flags: runhidden runascurrentuser;
Filename: "{app}\{#NSSM}";
Parameters: "set {#MyAppShortName} AppStdout {app}\{#MyAppShortName}.log";
Flags: runhidden runascurrentuser;
Filename: "{app}\{#NSSM}";
Parameters: "set {#MyAppShortName} AppStderr {app}\{#MyAppShortName}.log";
Flags: runhidden runascurrentuser;
Filename: "{app}\{#NSSM}";
Parameters: "set {#MyAppShortName} AppRotateFiles 1";
Flags: runhidden runascurrentuser;
Filename: "{sys}\net.exe";
Parameters: "start {#MyAppShortName}";
Flags: runhidden runascurrentuser;
And the log prompts from the installer when is run looks like this:
2015-09-07 20:41:22.616 -- Run entry --
2015-09-07 20:41:22.616 Run as: Current user
2015-09-07 20:41:22.616 Type: Exec
2015-09-07 20:41:22.616 Filename: C:\Monitor\nssm.exe
2015-09-07 20:41:22.616 Parameters: install Monitor C:\Monitor\winstart-server.bat
2015-09-07 20:41:24.262 Process exit code: 5
2015-09-07 20:41:24.262 -- Run entry --
2015-09-07 20:41:24.262 Run as: Current user
2015-09-07 20:41:24.262 Type: Exec
2015-09-07 20:41:24.262 Filename: C:\Monitor\nssm.exe
2015-09-07 20:41:24.262 Parameters: set Monitor AppStdin C:\Monitor\Monitor.log
2015-09-07 20:41:24.299 Process exit code: 3
2015-09-07 20:41:24.299 -- Run entry --
2015-09-07 20:41:24.299 Run as: Current user
2015-09-07 20:41:24.299 Type: Exec
2015-09-07 20:41:24.299 Filename: C:\Monitor\nssm.exe
2015-09-07 20:41:24.299 Parameters: set Monitor AppStdout C:\Monitor\Monitor.log
2015-09-07 20:41:24.365 Process exit code: 3
2015-09-07 20:41:24.365 -- Run entry --
2015-09-07 20:41:24.365 Run as: Current user
2015-09-07 20:41:24.365 Type: Exec
2015-09-07 20:41:24.365 Filename: C:\Monitor\nssm.exe
2015-09-07 20:41:24.365 Parameters: set Monitor AppStderr C:\Monitor\Monitor.log
2015-09-07 20:41:24.415 Process exit code: 3
2015-09-07 20:41:24.415 -- Run entry --
2015-09-07 20:41:24.415 Run as: Current user
2015-09-07 20:41:24.415 Type: Exec
2015-09-07 20:41:24.415 Filename: C:\Monitor\nssm.exe
2015-09-07 20:41:24.415 Parameters: set Monitor AppRotateFiles 1
2015-09-07 20:41:24.458 Process exit code: 3
As you can see, the first taks fails with 5 and then the others prompt a 3 because the service was not registered.
Any clues? Thank you very much on advance.
I think the problem is that windows already has a service called "Monitor" (sys/DRIVERS/monitor). Try changing the name of your service for something else!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.