ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Ivanov <rambiusparkisan...@yahoo.com>
Subject Re: Installer using Ant
Date Mon, 29 Mar 2004 07:48:18 GMT
Pritesh,

Can you explain what exactly you want to install? I
have made some successfull attempts to use Ant as an
installer of web applications. I did roughly the
following:
1) Install a database (MySQL in most cases)
2) Start it as a service(on Win), as a daemon (on
Linux)
3) Using <sql> task, initialize the database of your
application
4) Install Tomcat (easy if you use a zip archive)
using unzip task abd start it as a service(on Win), as
a daemon (on Linux)
5) Copy the war of your web in tomcat's webapp dir and
wait to be deployed.

I usually control the folders where the pieces of
sofware will be installed by using properties file.
There is also an <input> task that can read user
input, but I have never used it.

As for platform independence (or how to reach the
unreachable :)) ), I have never succeded in it 100%.
Let's take as an example Tomcat. Under Linux it is
easy to unzip it somewhere, then prepare some sh file
and copy them in /etc/rc.d so that the tomcat is
started as a daemon. But I have never found a way how
to install it easy as a service under Windows. (I know
there is jakarta installer of tomcat that do this but
in this way I have to use different tomcat bundles -
jakarta-tomcat.zip for linux and jakarta-tomcat.exe
for Windows). 
So my rule is: try hard to perform as many
installation steps from ant (which means platform
independence), for the rest steps do the manually or
write some platform dependent files say bat or sh.

Hope this helps
Ivan Ivanov

P.S. Well, I lied a little bit, since there is a
condition in ant called os, with which one can guess
the platform on which the installation is running.
After finding it one can invoke different targets. For
example:

<condition property="isLinux">
    <os family="linux"/>
</condition>

<condition property="isWindows">
    <os family="windows"/>
</condition>

<target name="install" depends="lin-install,
win-install">
    ...Do your common install steps here
</target>

<target name="win-install" if="isWindows">
    ...Do your windows specific install steps here
</target>

<target name="lin-install" if="isLinux">
    ...Do your linux specific install steps here
</target>
But is this platform independence we all looking for?

--- Pritesh saharey <pritesh@sqatester.com> wrote:
> I would like to know can i create an installer for
> my java application using ant both for Windows and
> Linux.
> 
> 
> 
> Pritesh Saharey
> BE(Mech)
> Software Engineer
> 
> 
>
_____________________________________________________________
> Join SQAtester.com Community  --->
> http://www.sqatester.com/testersarea/joinus.htm
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message