Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.SlaveWindowsService/ProjectInstaller.cs @ 6593

Last change on this file since 6593 was 5780, checked in by ascheibe, 14 years ago

#1233 worked on installer and slave

File size: 754 bytes
Line 
1using System;
2using System.Collections;
3using System.ComponentModel;
4using System.ServiceProcess;
5
6
7namespace HeuristicLab.Clients.Hive.SlaveCore.SlaveWindowsService {
8  [RunInstaller(true)]
9  public partial class ProjectInstaller : System.Configuration.Install.Installer {
10    public ProjectInstaller() {
11      InitializeComponent();
12    }
13
14    protected override void OnAfterInstall(IDictionary savedState) {
15      base.OnAfterInstall(savedState);
16
17      //try to start the service after installation
18      using (var serviceController = new ServiceController(this.serviceInstaller1.ServiceName, Environment.MachineName)) {
19        try {
20          serviceController.Start();
21        }
22        catch { }
23      }
24    }
25  }
26}
Note: See TracBrowser for help on using the repository browser.