You can call the Nant exec task to call InstallUtil and you can easily pass parameters to install or uninstall the service
<target name="install-service">
<exec program="${framework::get-framework-directory('net-2.0')}\InstallUtil.exe">
<arg value="-i" />
<arg value="/name=V1" />
<arg value="C:\Service\SomeService.exe" />
</exec>
</target>
source
share