Free cookie consent management tool by TermsFeed Policy Generator

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

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

#1233 worked on installer and slave

File size: 754 bytes
RevLine 
[5283]1using System;
2using System.Collections;
[5280]3using System.ComponentModel;
[5780]4using System.ServiceProcess;
[5280]5
6
[5599]7namespace HeuristicLab.Clients.Hive.SlaveCore.SlaveWindowsService {
[5280]8  [RunInstaller(true)]
9  public partial class ProjectInstaller : System.Configuration.Install.Installer {
10    public ProjectInstaller() {
11      InitializeComponent();
12    }
[5780]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    }
[5280]25  }
26}
Note: See TracBrowser for help on using the repository browser.