PDA

View Full Version : prunsrv.exe is not working with installanywhere execute command but works from cmd



rajeshbanuka
01-23-2016, 01:44 PM
Hi,

I need to create a windows service to run Java Application so I chose to go with Apache Commons Deamon. I have added an Execute Command step to my Install Sequence which calls prunsrv.exe to create the service.
The command looks like below

"$USER_INSTALL_DIR$$\$prunsrv.exe" //IS//TestService --Description="Test Service" --Install="$USER_INSTALL_DIR$$\$prunsrv.exe" --Jvm="$PROGRAMS_DIR_64$$\$jre1.8.0_45$\$bin$\$server$\$jvm.dll" --Classpath="$USER_INSTALL_DIR$$\$service.jar\" --StartMode=jvm --StartClass=TestLauncher --StartMethod=start --StartParams="$USER_INSTALL_DIR$" --StopMode=jvm --StopClass=TestLauncher --StopMethod=stop --StopParams="$USER_INSTALL_DIR$$" --LogPath="$USER_INSTALL_DIR$$\$logs" --LogLevel=Debug --LogJniMessages=1 --StdOutput=auto --StdError=auto --Startup=auto

When installed, the command shown in Log files looks fine, it creates required windows service but when I try to start the service it fails. Apache Logs reveal Missing ImageFile error. When i examine the service with prunmgr.exe, I see none of the properties set on the service as shown in the log file.

But when I execute the same command from Command Prompt (the command generated from InstallAnyWhere Log files) it just works fine. Although I see no reason why it should fails through InstallAnyWhere.

I renamed prunsrv.exe but still no luck.

I tried various opitons of having batch file, inline script etc., but none of them worked. Any help on this?

Rgds,
Rajesh B