diff --git a/smtpproxy.net/ProjectInstaller.cs b/smtpproxy.net/ProjectInstaller.cs index d219800..569de36 100644 --- a/smtpproxy.net/ProjectInstaller.cs +++ b/smtpproxy.net/ProjectInstaller.cs @@ -1,48 +1,32 @@ -using System.ComponentModel; -using System.Configuration.Install; -using System.ServiceProcess; - -namespace smtpproxy.net; - -[RunInstaller(true)] -public class ProjectInstaller : Installer -{ - private ServiceInstaller smtpproxyInstaller; - - private ServiceProcessInstaller processInstaller; - - private IContainer components; - - public ProjectInstaller() - { - processInstaller = new ServiceProcessInstaller(); - InitializeComponent(); - smtpproxyInstaller = new ServiceInstaller(); - processInstaller.Account = ServiceAccount.NetworkService; - smtpproxyInstaller.StartType = ServiceStartMode.Automatic; - smtpproxyInstaller.ServiceName = "SMTPProxy.NET"; - base.Installers.Add(processInstaller); - base.Installers.Add(smtpproxyInstaller); - } - - private void serviceInstaller1_AfterInstall(object sender, InstallEventArgs e) - { - } - - private void serviceProcessInstaller1_AfterInstall(object sender, InstallEventArgs e) - { - } - - protected override void Dispose(bool disposing) - { - if (disposing && components != null) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - private void InitializeComponent() - { - } -} +using System.ComponentModel; +using System.Configuration.Install; +using System.ServiceProcess; + +namespace smtpproxy.net +{ + [RunInstaller(true)] + public class ProjectInstaller : Installer + { + private readonly ServiceProcessInstaller processInstaller; + private readonly ServiceInstaller smtpproxyInstaller; + + public ProjectInstaller() + { + processInstaller = new ServiceProcessInstaller + { + Account = ServiceAccount.NetworkService + }; + + smtpproxyInstaller = new ServiceInstaller + { + StartType = ServiceStartMode.Automatic, + ServiceName = "SMTPProxy.NET", + DisplayName = "SBC SMTP Proxy Service", + Description = "Intercepts, logs, filters, and relays local SMTP traffic based on JSON profile rules." + }; + + Installers.Add(processInstaller); + Installers.Add(smtpproxyInstaller); + } + } +} \ No newline at end of file