Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.WindowsService/3.3/ProjectInstaller.cs @ 6744

Last change on this file since 6744 was 6744, checked in by ascheibe, 13 years ago

#1233

  • renamed last couple of folders
  • fixed an installer bug
  • now with more license headers and less magic numbers
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.