Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Configuration.Install;
- using System.Linq;
- using System.ServiceProcess;
- namespace Test.WindowService
- {
- [RunInstaller(true)]
- public partial class ProjectInstaller : System.Configuration.Install.Installer
- {
- public ProjectInstaller()
- {
- InitializeComponent();
- }
- protected override void OnAfterInstall(IDictionary savedState)
- {
- base.OnAfterInstall(savedState);
- using (ServiceController serviceController = new ServiceController(serviceInstaller1.ServiceName))
- {
- serviceController.Start();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement