[C#]安装WindowsService的关键步骤
2014-01-07 14:32
239 查看
使用.Net编写好了WindowsService以后,不安装到系统里就没有任何作用。
[添加Installer]
在服务的设计器画面,属性页面里,选择[Add Installer]链接。
如此便会生成两个新的组件,ServiceProcessInstaller和ServiceInstaller。
ServiceProcessInstaller组件用来保持服务运行时的账户类型和凭证信息(LocalSystem,LocalUser,User等)。
ServiceInstaller组件用来保持注册表(HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services)中服务的关联信息,包括 服务名,显示名称,依赖关系,启动类型--自动,手动等。
如果一个工程中有数个服务,则需要分别添加这些服务的ServiceInstaller,并且可以在Install和Uninstall事件中对安装和卸载服务进行额外的处理。
准备完毕后,就可以安装/卸载服务了
InstallUtil Myservice.exe
InstallUtil Myservice.exe /u
参考自:http://www.itmedia.co.jp/enterprise/articles/0502/01/news083_4.html
[添加Installer]
在服务的设计器画面,属性页面里,选择[Add Installer]链接。
如此便会生成两个新的组件,ServiceProcessInstaller和ServiceInstaller。
ServiceProcessInstaller组件用来保持服务运行时的账户类型和凭证信息(LocalSystem,LocalUser,User等)。
ServiceInstaller组件用来保持注册表(HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services)中服务的关联信息,包括 服务名,显示名称,依赖关系,启动类型--自动,手动等。
如果一个工程中有数个服务,则需要分别添加这些服务的ServiceInstaller,并且可以在Install和Uninstall事件中对安装和卸载服务进行额外的处理。
准备完毕后,就可以安装/卸载服务了
InstallUtil Myservice.exe
InstallUtil Myservice.exe /u
参考自:http://www.itmedia.co.jp/enterprise/articles/0502/01/news083_4.html
相关文章推荐
- oracle在win7-64位操作系统安装和卸载步骤(在windows service 2008中也试过可以)
- C#Windows Service程序的创建安装与卸载
- C#Windows Service服务程序的安装/卸载、启动/停止 桌面客户端管理程序设计
- C#制作Windows service服务系列一:制作一个可安装、可启动、可停止、可卸载的Windows service
- C# windowsService安装
- C#制作Windows service服务系列一:制作一个可安装、可启动、可停止、可卸载的Windows service
- C# VS 2010创建、安装、调试 windows服务(windows service)
- C#中级-Windows Service程序安装注意事项
- vs.net c# 安装、注册windows service服务,判断服务是否存在,是否启动
- C# windows服务:通过cmd命令安装、卸载、启动和停止Windows Service(InstallUtil.exe)
- c# 安装和卸载Windows Service(程序)
- C# VS 2010创建、安装、调试 windows服务(windows service)
- C#制作Windows service服务系列一:制作一个可安装、可启动、可停止、可卸载的Windows service
- C#windows service服务安装、注册、判断服务是否存在、是否启动
- C# WindowsService安装与卸载
- C#windows service C#windows 服务安装卸载SC
- vs.net c# 安装、注册windows service服务,判断服务是否存在,是否启动
- C#制作Windows service服务系列一:制作一个可安装、可启动、可停止、可卸载的Windows service
- C#制作Windows service服务系列一:制作一个可安装、可启动、可停止、可卸载的Windows
- Windows 安装 windows Service 步骤