views:

995

answers:

5
+1  Q: 

Create Installer

Hi All,

How to create a installer using Java that combine tomcat, mysql and war file and come out a final exe?

+1  A: 

I would suggest, that you use Java for this, a installer.jar. As you would like to run tomcat anyway, theres no need to put in a exe file. We've done something similar, programming an jar installer with the help of the Ant API (Ant used programmatically).

Mork0075
Can you give a bit more information on this, I'd like to know more about it and how it's done.
PintSizedCat
Download the Ant jar from the Apache website and play a bit with the API. Instead of using perhaps the XML command <copy> u use a class Copy und run some methods.
Mork0075
oh, I see what you mean. so you install it when you compile as opposed to deploying an installation to a client/server machine?
PintSizedCat
Yes, the installer.jar can be downloaded from a Mercurial repository. After this the installer takes control, downloads the software (also from a repository), compiles and deploys it as a service.
Mork0075
+3  A: 

The possible options have been largely covered in several questions already, especially:

...and other questions tagged java + installer

Although admittedly some options mentioned in those questions cannot produce self-sufficient .exe installers. If a commercial tool is ok for you, I can personally recommend install4j; among other things, it can create .exe installers (details about my experiences with it). Or, for a simpler, free tool for producing Windows executables out of Java programs, see Launch4j.

Update of my install4j recommendation, based on this comment by OP:

Yes, the exe installer need to install the tomcat, mysql, web application, and db script all in once. At the end, users only need to start the tomcat and mysql service. Go to browser can access the web application.

With install4j,

  • you can bundle Tomcat, MySQL and your webapp just fine
  • you can automatically start the services too from the installer (or leave it to users as you suggest)
  • if you want, the installer can even directly launch the browser and point it to your webapp :-)

I have just done a similar thing with install4j (bundle application server, webapp, run database scripts, and many other things; without bundling the database however), so I'm relatively sure it can be done. I do not know if you can do this (easily) with the free tools such as Launch4j.

Jonik
-1 This isn't covered in any of the above. He is clearly talking about installation of tomcat and mysql with a WAR not a java application but a java webapp.
PintSizedCat
Well, it has been covered to some extent, since for example with install4j you can include Tomcat, MySQL, WAR files or whatever you wish.
Jonik
I mean, if we're talking about creating .exe installers for Java software, the possible tools will be the same anyway, no matter if it is a web application or not.
Jonik
Only since your last update and still you center around installation of jars which is very different from what is being asked and it clearly isn't 'java software' is it?
PintSizedCat
Nope, I never centered around installing JARs. If you look at e.g. install4j (http://www.ej-technologies.com/products/install4j/features.html), you'll see it can do pretty much anything, even if it's specifically geared towards installing Java software.If .exe installer is a requirement (as it seems to be), I still think the most appropriate tools will probably be ones I'm pointing to.
Jonik
+3  A: 

You could use any installer, really. I personally have used InnoSetup, which is quite simple, but can still perform almost any task at installation time.

In your case, you probably want to place the Tomcat files somewhere, webapp included. Customize some configuration files and run the MySQL installer in silent mode. All of which is perfectly possible with InnoSetup.

If you need more flexibility, you can look at NSIS, another very simple but very powerful installer app.

Gerco Dries
Thank for ur recommendation..InnoSetup is good and easy to use.
Wilson
Someone posted a follow-up question about how to do this with Inno Setup: http://stackoverflow.com/questions/938925/how-to-use-inno-setup-to-create-an-installer-for-installing-the-tomcat-mysql-we
Jonik
A: 

Hi, I want to create installer for my Java application too, along MySQL, Tomcat and related programs. But all of suggested installer in this page are Windows platform, I need an platform independent installer with these features. I will be appreciated if help me.

Thanks in advance.

Fazileh

Fazileh
A: 

You can use BitRock InstallBuilder for it. For examples of such programs, checkout Alfresco, Liferay, etc. application installers that include Tomcat, MySQL, etc. at BitNami

Daniel Lopez