Rev | Line | |
---|
[5283] | 1 | using System;
|
---|
| 2 | using System.Collections;
|
---|
[5280] | 3 | using System.ComponentModel;
|
---|
[5780] | 4 | using System.ServiceProcess;
|
---|
[5280] | 5 |
|
---|
| 6 |
|
---|
[5599] | 7 | namespace 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.