diff --git a/DnsService/ProjectInstaller.cs b/DnsService/ProjectInstaller.cs index 36a7dfbb..d81bc790 100644 --- a/DnsService/ProjectInstaller.cs +++ b/DnsService/ProjectInstaller.cs @@ -17,12 +17,22 @@ namespace DnsService private void ServiceInstaller1_AfterInstall(object sender, InstallEventArgs e) { - new ServiceController(serviceInstaller1.ServiceName).Start(); + try + { + new ServiceController(serviceInstaller1.ServiceName).Start(); + } + catch + { } } private void ServiceInstaller1_BeforeUninstall(object sender, InstallEventArgs e) { - new ServiceController(serviceInstaller1.ServiceName).Stop(); + try + { + new ServiceController(serviceInstaller1.ServiceName).Stop(); + } + catch + { } } } }