I want to run a service using NSSM, doing so from Command Prompt (ran as administrator) works. Commands used in command prompt are:
# Command Prompt commands
C:\Windows\system32>cd C:\Users\D-002\Downloads\nssm-2.24\win64
C:\Users\D-002\Downloads\nssm-2.24\win64>
nssm install TestService "C:\Program Files (x86)\CodeBlocks\Testing Projects\TestServiceProgram\bin\Debug\TestServiceProgram.exe"
Service "TestService" installed successfully!
But I want to achieve same functionality using NSIS. Running following script doesn't create TestService.
# NSIS script
; name the installer
OutFile "Installer.exe"
; default section start; every NSIS script has at least one section.
Section
;nssm folder is placed in same folder where Installer.exe is created
ExecWait 'cd "$EXEDIR\nssm\win64"'
ExecWait 'nssm install TestService "$EXEDIR\TestServiceProgram.exe"'
; default section end
SectionEnd
As I have no prior knowledge of NSIS, if anybody could indicate, what I am doing wrong or missing ?