Files
tgstation-server/TGServerService/ProjectInstaller.cs
T
Jordan Brownandoranges 8c6d31f394 TGS3 (#3)
Let's just get this merged instead of having a massive PR

Original PR: tgstation/tgstation#26534
2017-06-01 13:06:42 +12:00

29 lines
638 B
C#

using System.ComponentModel;
using System.Configuration.Install;
using System.ServiceProcess;
namespace ServerService
{
[RunInstaller(true)]
public partial class ProjectInstaller : Installer
{
public ProjectInstaller()
{
InitializeComponent();
serviceInstaller1.BeforeUninstall += ServiceInstaller1_BeforeUninstall;
}
private void ServiceInstaller1_BeforeUninstall(object sender, InstallEventArgs e)
{
}
private void ServiceInstaller1_AfterInstall(object sender, InstallEventArgs e)
{
using (ServiceController sc = new ServiceController(serviceInstaller1.ServiceName))
{
sc.Start();
}
}
}
}