AndreG
Posts: 57
Joined: Tue Jun 10, 2014 11:41 am

Can't get custom Tomcat 7 to install as a Windows Service

Following on from a previous topic, I've run into an issue now where my custom Tomcat service is not getting any of it's runtime configuration set.

My AI package has a service entry named "fenxitomcat7", following the file name "fenxitomcat7.exe". This installs with the name I expect, but it refuses to start. Attempting to start it through the Windows Services panel I instantly get a message stating "Error 1053: The service did not respond to the start or control request in a timely fashion". If I run the "fenxitomcat7w.exe" service configuration wrapper, none of the options under the "Java", "Startup" or "Shutdown" tabs have been set up.

I started getting issues after upgrading to 11.5.1 and attempting to bundle a JRE in my AI package. Since that point I've tried recreating the package from scratch in 11.5.1, as well as downgrading to 11.4.1 (where it worked previously) and recreating the package again. Each time I've tried this I end up with a service that won't start and appears to not have any configuration set.

Installing the service using Tomcat's included "service.bat" file is one option, but I would much prefer to have AI handle this aspect. Can anyone tell me what might be going wrong here? I've been fighting with this pretty much all day and I'm completely stumped..
Daniel
Posts: 8244
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Can't get custom Tomcat 7 to install as a Windows Servic

Hello,

I apologize for my delayed reply.

I'm not so sure why this happens. Our "Services" page uses the Windows Installer standard support to install services, which make use of the "CreateService" system function. Please take a look on the "ServiceInstall Table" and "ServiceControl Table" articles.

Also, from what I know the recommend way to install the Tomcat service is by using the "service.bat" batch file. So, as a workaround you should use a custom action which launch the "service.bat" file in order to install the Tomcat service.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AndreG
Posts: 57
Joined: Tue Jun 10, 2014 11:41 am

Re: Can't get custom Tomcat 7 to install as a Windows Servic

Thanks for the suggestions.
Daniel wrote:I'm not so sure why this happens. Our "Services" page uses the Windows Installer standard support to install services. Please take a look on the "ServiceInstall Table" and "ServiceControl Table" articles.
Can't get to check my project at this moment, but I'm guessing the pages on MSDN that you're referring to would relate to entries in AIP's "Table Editor" panel? I'll dig through that a bit later and see what I find.
Daniel wrote:Also, from what I know the recommend way to install the Tomcat service is by using the "service.bat" batch file. So, as a workaround you should use a custom action which launch the "service.bat" file in order to install the Tomcat service.
I actually reworked the majority of the bundled batch files to configure the environment the way I want; as it stands now I'm running my custom Java app and Tomcat using my installer's bundled JRE. It works like this, so there are no issues there, it just looks a bit messy having a black command prompt window flash for the TC service installation. It's not an urgent issue, so I''ll play around with this and post back if I manage to find anything helpful. :)
Daniel
Posts: 8244
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Can't get custom Tomcat 7 to install as a Windows Servic

Hello,
Can't get to check my project at this moment, but I'm guessing the pages on MSDN that you're referring to would relate to entries in AIP's "Table Editor" panel? I'll dig through that a bit later and see what I find.
This is correct.
It works like this, so there are no issues there, it just looks a bit messy having a black command prompt window flash for the TC service installation. It's not an urgent issue, so I''ll play around with this and post back if I manage to find anything helpful.
In order to hide the command prompt window you can use a "Launch file" predefined custom action to launch your BAT files and enable the "Hide program's window" custom action option.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AndreG
Posts: 57
Joined: Tue Jun 10, 2014 11:41 am

Re: Can't get custom Tomcat 7 to install as a Windows Servic

Daniel wrote:...and enable the "Hide program's window" custom action option.
Brilliant, thank you. I completely missed that little tick box. :)

Thanks for all the help, greatly appreciated.
Daniel
Posts: 8244
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Can't get custom Tomcat 7 to install as a Windows Servic

You're welcome.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”