Advertisement
Guest User

Untitled

a guest
May 3rd, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Configuration.Install;
  6. using System.Linq;
  7. using System.ServiceProcess;
  8.  
  9. namespace Test.WindowService
  10. {
  11. [RunInstaller(true)]
  12. public partial class ProjectInstaller : System.Configuration.Install.Installer
  13. {
  14. public ProjectInstaller()
  15. {
  16. InitializeComponent();
  17. }
  18. protected override void OnAfterInstall(IDictionary savedState)
  19. {
  20. base.OnAfterInstall(savedState);
  21. using (ServiceController serviceController = new ServiceController(serviceInstaller1.ServiceName))
  22. {
  23. serviceController.Start();
  24. }
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement