I did as you suggested and no log was generated. If i run the wrapper.bat the log is generated, but when instaled as service no.
I did as you suggested and no log was generated. If i run the wrapper.bat the log is generated, but when instaled as service no.
There must be some restriction with Windows services that we can't guess at the moment, or something in your deployment that is different from what we expect and that we still can't see.
But now you can remove Lightstreamer from the equation.
Please change wrapper.bat to issuing:
and put NOLS.bat beside LS.bat, which just does:.\NOLS.bat > out.txt
Can you confirm that when you install the service you now see out.txt while you didn't see it in the previous attempts?echo test
I did as you suggested and no log was generated. But this time i went futher. I tried to install the service without the Install_LS_as_Service-NT.bat. I ran "mssn.exe install Lightstreamer" and in the diolog that opened I chose my wrapper.bat then started the service manualy and the Lightstreamer started successfully.
This is the Install_LS_as_Service-NT.bat
@echo off
setlocal
rem
rem NSSM Lightstreamer NT service install script
rem
if "%OS%"=="Windows_NT" goto nt
echo This script only works with NT-based versions of Windows.
goto :end
:nt
echo Attention Windows Vista and Windows 7 users, this
echo script must be run as Administrator.
echo Once the service is installed, do not move nssm*.exe files!
echo ...
echo Please check the output below
echo ...
rem Remove the service
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" goto amd64nssm
goto x86nssm
:x86nssm
%0\..\nssm.exe install Lightstreamer %0\..\LS.bat run
goto :startserv
:amd64nssm
%0\..\nssm_x64.exe install Lightstreamer %0\..\LS.bat run
goto :startserv
:startserv
net start Lightstreamer
:end
pause
Thank you for finding the workaround.
Admittedly, we can't find an explanation for this behavior at the moment, as it doesn't replicate on our machines.
We will try to investigate and also ask for suggestions.
While using "%0\.." to 'sort of' determine the path to the application, it does not work in all circumstances. For example if you open a command window, and navigate to the bin\windows directory, and run Install_LS_as_Service-NT.bat from there, the values entered into the registry for the service are incorrect as follows:
Parameters\AppDirectory = Install_LS_as_Service-NT.bat\..
Parameters\Application = Install_LS_as_Service-NT.bat\..\LS.bat
obviously that won't work.
Now if you double click Install_LS_as_Service-NT.bat from windows explorer, you'll end up with this (which does work - although I wouldn't call this a very elegant solution - having the script filename in the path):
Parameters\AppDirectory = C:\Lightstreamer\bin\windows\Install_LS_as_Service-NT.bat\..
Parameters\Application = C:\Lightstreamer\bin\windows\Install_LS_as_Service-NT.bat\..\LS.bat
Seems like the Install_LS_as_Service-NT.bat scrip needs some work.
What really needs to be in the Registry is (to be nice and clean):
Parameters\AppDirectory = C:\Lightstreamer\bin\windows
Parameters\Application = C:\Lightstreamer\bin\windows\LS.bat
This can be accomplished by changing the script as follows:
And now will work from either the command window, or windows explorer.Code:@echo off setlocal rem rem NSSM Lightstreamer NT service install script rem if "%OS%"=="Windows_NT" goto nt echo This script only works with NT-based versions of Windows. goto :end :nt echo Attention Windows Vista and Windows 7 users, this echo script must be run as Administrator. echo Once the service is installed, do not move nssm*.exe files! echo ... echo Please check the output below echo ... rem Remove the service if "%PROCESSOR_ARCHITECTURE%" == "AMD64" goto amd64nssm goto x86nssm :x86nssm %~dp0\nssm.exe install Lightstreamer %~dp0%LS.bat run goto :startserv :amd64nssm %~dp0\nssm_x64.exe install Lightstreamer %~dp0%LS.bat run goto :startserv :startserv net start Lightstreamer :end pause
Thank you for pointing out the subtleties of the "%0\.." form.
Actually, we assumed that the "%~" forms might not be supported everywhere, but the assumption was probably wrong, or it is now obsolete.
We will apply your suggestion on the next release.
Bookmarks