Add the following class to your project.
using System.ServiceProcess;
class ServInstaller : ServiceInstaller
{
protected override void OnCommitted(System.Collections.IDictionary savedState)
{
ServiceController sc = new ServiceController("YourServiceNameGoesHere");
sc.Start();
}
}
The Setup Project will pick up the class and run your service after the installer finishes.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…