1.安装一个服务
假设服务的路径如下:d:\windowsServiceTest\bin\release下
用installutil命令安装
installutil windowsService.exe
2.卸载一个服务
假设服务的路径如下:d:\windowsServiceTest\bin\release下
用uninstallutil命令卸载
installutil /u windowsService.exe
3.创建windows service
(1)Service
创建一个服务程序,这个程序用来处理服务,给参数serviceName一个名字,这是你的服务 名称。
(2)ProjectInstaller
创建一个安装服务程序,这个程序用来安装你的服务程序到Windows service中
有几个参数需要设置 一个是ServiceName ,这个参数要和 service 中的一样
。另一个是accout,设成localSystem.
4.几个重要的类
System.ServiceProcess.ServiceBase
System.ServiceProcess.ServiceController
System.ServiceProcess.ServiceInstaller