简体   繁体   中英

How to install application as windows service using NSIS script?

I have written nsis script for my java project. I have successfully created a exe file using this nsis script. Final step of my installation process is installing my application as windows service using a batch file. I have installed successfully through command line using following code

"c:\program Files\program Files\test\bin\prunsrv.exe" //IS//servicename --Startup=auto --Jvm="Auto" --Classpath="%CLASSPATH%" --StartMode=jvm --StartClass=com.class.name  --StartParams start --StopMode=jvm --StopClass=com.class.name --StopParams stop

same commands I have executed through nsis script is not working well. I have tried the following code

Exec '"$INSTDIR\bin\prunsrv.exe" //IS//servicename --Startup=auto --Jvm="Auto" --Classpath="%CLASSPATH%" --StartMode=jvm --StartClass=com.class.name  --StartParams start --StopMode=jvm --StopClass=com.class.name --StopParams stop' 

$INSTDIR refer to this directory c:\\program Files\\test.

在执行前使用ExpandEnvStrings扩展%classpath%...

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM