Batch Script to Install or Uninstall a .NET Windows Service

后端 未结 10 1556
我在风中等你
我在风中等你 2021-01-31 05:13

I have no experience writing batch scripts, but I was wondering if there was a way to install a .NET Windows service using installutil.exe using such a script, or u

10条回答
  •  离开以前
    2021-01-31 05:50

    You could setup your service exe to support self registration / unregistration using command line arguments (-i -u etc) instead of writing a batch file to do the same thing.

    Information on creating Self Installing Services In .NET

    http://anotherlab.rajapet.net/2006/06/self-installing-services-in-net.html

    http://www.gotnet.biz/WindowsServiceSelfInstaller.ashx

    Also adding a Setup Project to your solution and having Visual Studio build an install package might be faster.

    How to create a Setup project for a Windows Service in Visual Basic .NET or in Visual Basic 2005

    (VB) http://support.microsoft.com/kb/317421

    (C#) http://support.microsoft.com/kb/816169

提交回复
热议问题