I don't believe there's a specific task, so we do something like this:
<target name="InstallService">
<!--
Check if the service is already
installed.
ServiceController will error if we
try to control a non-existent service.
-->
<if test="${service::is-installed(svc.name,
'.')}">
<!-- Stop the service if necessary.
MSIEXEC seems a little hesitant to do it itself -->
<if test="${not
service::is-stopped(svc.name, '.')}">
<servicecontroller
machine="." service="${svc.name}" action="Stop" />
</if>
</if>
<echo message="Installing
${path::combine(setup.dir, svc.msi)}" />
<!-- Call MSIEXEC to install the desired MSI
package in quiet unattended mode -->
<exec
program="msiexec"
commandline="/package
${path::combine(setup.dir, svc.msi)} /passive /qn"
/>
<!-- Start the service. MSIEXEC seems a little
hesitant to do it itself -->
<servicecontroller machine="."
service="${svc.name}" action="Start" />
</target>
You'll need NAntContrib to run some of these tasks. It's reasonably
parameterised - just set svc.name and svc.msi to the name of the Windows
service and the name of the .msi package respectively before calling the
target; it works well for us with three services to install.
Regards,
David Keaveny
________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Deepak
Surendran
Sent: Friday, 18 May 2007 4:01 PM
To: NANT Mailing List
Subject: [NAnt-users] Infomation Required
Hi,
Using NANT file i am able to create MSI for my project. Whether is it
possible to install the MSI automatically using NANT file.
I have automated the nant build file in our build server.It will create
the MSI in our build server.So every time we have to install the MSI
manually. Is there is any way to install the MSI automatically .
Regards,
Deepak S
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users