使用NAnt在构建脚本中安装/卸载Windows服务 [英] Install/Uninstall a Windows Service in a build script with NAnt

查看:134
本文介绍了使用NAnt在构建脚本中安装/卸载Windows服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

NAnt是否可以使用InstallUtil实用程序或其他工具来安装或卸载Windows服务?

Does NAnt have the ability to install or uninstall a windows service, using the InstallUtil utility or whatever else?

推荐答案

您可以致电Nant的

You can call Nant's exec task to call InstallUtil and can pass parameters to install or uninstall a service easily

 <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>

这篇关于使用NAnt在构建脚本中安装/卸载Windows服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆