I created an installer with install4j that calls the provided Tomcat service.bat file to create a Windows service.
That works fine, but is there anyway to modify the service.bat so by default the installed service is Automatic (Delayed Start) as opposed to Automatic or Manual?
According to this page: http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html
The --Startup parameter takes either auto or manual with a default of manual if left empty. I'm a little confused because I left it out and my services are set to Automatic after installation, which contradicts that page.
Doesn't seem like a parameter for Automatic (Delayed Start) is supported so I ended up simply calling a .bat file after the service is installed. It sets the appropriate key/value in the Windows registry to mark a service as delayed-start.
reg add "HKLM\SYSTEM\CurrentControlSet\services\%1" /v DelayedAutostart /t REG_DWORD /d 0x1 /f"
Just run the batch file, passing an argument for the service name.
automaticDelayedStart.bat MyService