I'm using NSIS to install an application that includes tomcat and have been trying to have it install tomcat as a service by executing the service.bat file after the files are extracted to the system.
My script includes
ExecWait '"$INSTDIR\tomcat\bin\service.bat" install'
I see the command window open and close, but the service doesn't install. I can run the command manually after install and the service installs fine. When I uninstall the service is also removes fine.
I'm also executing other batch files during the install, which also install applications as services and they work fine. Any ideas?
ExecWait
6 posts
Try:
ReadEnvStr $R0 COMSPEC
ExecWait ExecWait '$R0 /C "$INSTDIR\tomcat\bin\service.bat" install'
-Stu
ReadEnvStr $R0 COMSPEC
ExecWait ExecWait '$R0 /C "$INSTDIR\tomcat\bin\service.bat" install'
-Stu
Hm is it me or is there no difference between ReadEnvStr and ExpandEnvStrings?
Also why put ExecWait twice? 🙂
Also why put ExecWait twice? 🙂
Hm is it me or is there no difference between ReadEnvStr and ExpandEnvStrings?I think it's you 😉. Maybe Afrow UK was also that way 😉.
This is how I am installing Tomcat 5 as a service and it works fine for me.
;Install Tomcat 5 as a Windows service
SetOutPath "$INSTDIR\Tomcat5\bin"
nsExec::Exec '"service.bat" install'
but you have to make sure that the service.bat file is changed so the Tomcat service is set to start automaticaly by adding "--Startup auto" as follows:
"%EXECUTABLE%" //US//%SERVICE_NAME% ++JvmOptions "-Djava.io.tmpdir=%LOCAL_ALERT_HOME%\temp" --JvmMs 128 --JvmMx 256 --Startup auto
Then the next step is to start Tomcat 5 service, the command that I use is windows commandline:"net start Tomcat5" which can be embeded in the service.bat file as well, or if executet by NSIS installer than use:
nsExec::Exec "net start LocalAlertTomcat5"
;Install Tomcat 5 as a Windows service
SetOutPath "$INSTDIR\Tomcat5\bin"
nsExec::Exec '"service.bat" install'
but you have to make sure that the service.bat file is changed so the Tomcat service is set to start automaticaly by adding "--Startup auto" as follows:
"%EXECUTABLE%" //US//%SERVICE_NAME% ++JvmOptions "-Djava.io.tmpdir=%LOCAL_ALERT_HOME%\temp" --JvmMs 128 --JvmMx 256 --Startup auto
Then the next step is to start Tomcat 5 service, the command that I use is windows commandline:"net start Tomcat5" which can be embeded in the service.bat file as well, or if executet by NSIS installer than use:
nsExec::Exec "net start LocalAlertTomcat5"
Copy + Paste error 😛
ExpandEnvStrings allows you to expand all environment strings in an entire string!
E.g.
%PROGRAMFILES%\%BLAHPATH%\file.ext
ReadEnvStr is for a single environment string, e.g. PROGRAMFILES or COMSPEC.
-Stu
ExpandEnvStrings allows you to expand all environment strings in an entire string!
E.g.
%PROGRAMFILES%\%BLAHPATH%\file.ext
ReadEnvStr is for a single environment string, e.g. PROGRAMFILES or COMSPEC.
-Stu