java - how to make prunsvr work from NSIS script -
i have nsis script responsible creating out installer. installer copies files our java application uses prunsvr install windows service. when run targeting exe file built using launch j, works. want able respond wsm messages in application perform cleanup / logging. nsis script creates service so:
execwait '"$instdir\prunsrv.exe" "//is//${project}" --displayname="ipti ${project}" --install="$instdir\prunsrv.exe" --classpath="$instdir\host interface.jar" --startmode="java" --startclass="com.ipti.ptl.hostinterfaceservice.hostinterfaceservice" --stopmode="java" --stopclass="com.ipti.ptl.hostinterfaceservice.hostinterfaceservice" --startup="auto" --startpath="$instdir"' execwait 'net start "ipti ${project}"'
the method above fails create service run method works fine (targeting exe)
execwait '"$instdir\prunsrv.exe" "//is//${project}" --displayname="ipti ${project}" --install="$instdir\prunsrv.exe" --startmode=exe --startimage="$instdir\${project}.exe" --startup=auto --startpath="$instdir"' execwait 'net start "ipti ${project}"'
i added following main method work prunsvr when not targeting exe:
public static void main(string[] args) throws exception { common.deployresources(); if (args.length > 0 && args[0].equals("start")) { hostinterfaceservice hi = new hostinterfaceservice(); hi.launch(); } else { system.exit(0); } }
i have tried using start , stop methods specified --startclass --startmethod --stopclass , --stopmethod.
no matter try, invariably error. when try start service manager error code 1 or 4. no other information @ all. doing wrong?
my event viewer shows only:
the ipti host interface service terminated service-specific error incorrect function.
according blog-entry have rename prunsrv.exe service name.
maybe can try first sample service given there.
Comments
Post a Comment