VS Setup - 关于Windows Service
来源:互联网 发布:免费的收音机不用网络 编辑:程序博客网 时间:2024/06/05 03:35
前面写过一篇使用VS Setup项目作安装包的总结,今天补充两点关于打包Windows Service的tips:
1. 如何安装windows service? - 使用service installer
2. 如何在安装向导完成后,启动刚安装完成的service?
2.1 使用Custom Action并在Installer的Committed事件中启动service
2.2 将此Custom Action 添加到安装项目的Custom Actions 编辑器的Commit节中
Custom Action代码示例如下:
Imports System.Configuration.Install
Imports System.ServiceProcess
Imports System.ComponentModel
<RunInstaller(True)> _
Public Class CustomActionManager
Inherits Installer
Private Const Service_Name As String = "MyService"
Public Sub New()
MyBase.New()
AddHandler Committed, AddressOf CustomActionManager_Committed
End Sub
Private Sub CustomActionManager_Committed(ByVal sender As Object, ByVal e As InstallEventArgs)
'need to put this custom action under the Commit section of Setup -> Custom Actions wizard
Dim svcController As New ServiceController(Service_Name)
Try
svcController.Start()
Catch ex As Exception
MsgBox("failed to start service " + Service_Name)
Finally
svcController.Dispose()
End Try
End Sub
End Class
- VS Setup - 关于Windows Service
- VS Setup - 关于Windows Service
- 关于Windows Service
- VS Add Service Reference from Windows Azure
- VS 2010 制作 Windows Service 安装包
- Working with Windows Service Using VS 2005
- VS setup project
- VS.NET setup project
- vs setup 失败
- Setup vsftpd service
- inno setup打包service
- C# VS 2010 创建、安装、调试 windows服务(windows service)
- C# VS 2010创建、安装、调试 windows服务(windows service)
- C# VS 2010创建、安装、调试 windows服务(windows service)
- C# VS 2010创建、安装、调试 windows服务(windows service)
- C# VS 2010创建、安装、调试 windows服务(windows service)
- C# VS 2010创建、安装、调试 Windows服务(Windows Service)
- C# VS 2010 创建、安装、调试 windows服务(windows service)
- String, StringBuffer, StringBuilder区别
- 由 EditorBrowableAttribute 引发的一些问题
- 细谈C语言中的strcpy,strncpy,memcpy,memmove,memset函数
- 压缩解压:tar zip unzip 7z|7za rar
- 使用VS的安装项目的总结
- VS Setup - 关于Windows Service
- 批处理脚本的使用
- Anjuta—基于GTK+/GNOME的C/C++优秀开发环境
- Volatile(与多线程编程等方面有关的一个关键字)
- android学习笔记之3D--(03)-Renderer类 渲染类
- EJB中事务处理的两种方式
- Flex 菜单效果
- 进制转化算法(C++实现)——创新工场笔试归来
- SAP-CO.创建成本中心,作业类型,内部订单