David Keaveny - 2006-07-21

Logged In: YES
user_id=152545

I'm not aware of one either, so I use the following:

<property name="installer.exe"
value="${framework::get-framework-directory(nant.settings.currentframework)}\InstallUtil.exe"
/>

<if test="${service::is-installed('MyWindowsService', '.')}">
<exec
commandline="/u MyWindowsService.exe"
program="${installer.exe}"
failonerror="false" />
</if>

The ${service::is-installed} function was introduced with
0.85-rc4, so make sure you're fully up-to-date. The
InstallUtil.exe program will automatically shut down the
service if it is running, but you can always use the
${service::is-running} function together with the
<servicecontroller> task to do it yourself.