windows - 使用 NAnt 在构建脚本中安装/卸载 Windows 服务

标签 windows windows-services build-automation nant installutil

NAnt 是否能够使用 InstallUtil 实用程序或其他任何工具安装或卸载 Windows 服务?

最佳答案

您可以调用南特的exec调用 InstallUtil 的任务,并可以传递参数来轻松安装或卸载服务

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

关于windows - 使用 NAnt 在构建脚本中安装/卸载 Windows 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3416872/

相关文章:

continuous-integration - Hudson 基于 URL token 构建

ios - 比特桶管道 : Build iOS for CI CD without external dependency

visual-studio - 免费的Visual Studio构建自动化解决方案

linux - 将 JBoss 作为 Windows 服务运行有什么用?

c# - Windows 服务 canStop 属性

c++ - 如何使用 Windows native Wifi 功能连接到请求网络安全 key 的 Wifi?

python - python 2.6 中 100mb 文件的多个字符串替换

windows - 我可以将 windbg 用作 Windows 服务的事后调试器吗?

windows - 如何获取 Windows 批处理文件中的其余参数?

windows - 如何在 Windows 上安装 cran 软件包?