cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
hrmsys
Level 3

How to create and configure a Tomcat 6 service?

Hi everybody,

I need to create and configure a Tomcat 6 service.

Previously this was done through the 'service.bat' file. As newer Windows versions are more restrictive it's probably better to create the service using an InstallShield provided functionality.

What is the recommended way to create and configure a Tomcat 6 service with InstallShield 2010 under Windows 7?

Does anybody have an example?

I tried to do it using the following method, but the configuration options are just getting ignored, while the service is getting created. How can I set the options using InstallScript?

Thanks a lot for any help!!!

My method:

function f_install_TomcatService(hMSI)

STRING szServiceName;
STRING szServiceDisplayName;
STRING szServiceDescription;
STRING szInstallDir;
STRING szServicePathFile;
STRING szStartServiceArgs;
STRING szDBPrgPath;
STRING szJvmOptions;

begin
szServiceName = "gaWebapps";
szServiceDisplayName = "ga Webapps";
szServiceDescription = "ga Web Applications, powered by ga Systems AG";
szInstallDir = "C:\\Programme\\tomcat";
szServicePathFile = szInstallDir + "\\bin\\tomcat6.exe //RS//gaWebapps";

szDBPrgPath = "C:\\Programme\\ga\\db-prg\\win32";

szJvmOptions = "-Dcatalina.base=" + szInstallDir + ";-Dcatalina.home=" + szInstallDir +
";-Djava.endorsed.dirs=" + szInstallDir + "\\endorsed;-XX:MaxPermSize=256m;-Djava.library.path=" + szDBPrgPath +
";-Djava.io.tmpdir=" + szInstallDir + "\\temp";

szStartServiceArgs = "//IS//" + szServiceName + " --StartClass org.apache.catalina.startup.Bootstrap --StopClass org.apache.catalina.startup.Bootstrap";
szStartServiceArgs = szStartServiceArgs + " --StartParams start --StopParams stop --JvmOptions " +
szJvmOptions + " --StartMode jvm --StopMode jvm --Startup auto --JvmMs 128 --JvmMx 256 --JvmServer";

MessageBox( szServicePathFile, INFORMATION );
MessageBox( szStartServiceArgs, INFORMATION );

ServiceAddService( szServiceName, szServiceDisplayName, szServiceDescription, szServicePathFile, TRUE, szStartServiceArgs );
end;
Labels (1)
0 Kudos
(1) Reply
budyman
Level 2

Have you found a solution ??

thx,

Julien
0 Kudos