Cleaned & Updated ProjectInstaller.cs

This commit is contained in:
2026-08-17 10:30:32 +10:00
parent 1d6e8e23a8
commit 44e40c7846

View File

@@ -1,48 +1,32 @@
using System.ComponentModel; using System.ComponentModel;
using System.Configuration.Install; using System.Configuration.Install;
using System.ServiceProcess; using System.ServiceProcess;
namespace smtpproxy.net; namespace smtpproxy.net
{
[RunInstaller(true)] [RunInstaller(true)]
public class ProjectInstaller : Installer public class ProjectInstaller : Installer
{ {
private ServiceInstaller smtpproxyInstaller; private readonly ServiceProcessInstaller processInstaller;
private readonly ServiceInstaller smtpproxyInstaller;
private ServiceProcessInstaller processInstaller;
public ProjectInstaller()
private IContainer components; {
processInstaller = new ServiceProcessInstaller
public ProjectInstaller() {
{ Account = ServiceAccount.NetworkService
processInstaller = new ServiceProcessInstaller(); };
InitializeComponent();
smtpproxyInstaller = new ServiceInstaller(); smtpproxyInstaller = new ServiceInstaller
processInstaller.Account = ServiceAccount.NetworkService; {
smtpproxyInstaller.StartType = ServiceStartMode.Automatic; StartType = ServiceStartMode.Automatic,
smtpproxyInstaller.ServiceName = "SMTPProxy.NET"; ServiceName = "SMTPProxy.NET",
base.Installers.Add(processInstaller); DisplayName = "SBC SMTP Proxy Service",
base.Installers.Add(smtpproxyInstaller); Description = "Intercepts, logs, filters, and relays local SMTP traffic based on JSON profile rules."
} };
private void serviceInstaller1_AfterInstall(object sender, InstallEventArgs e) Installers.Add(processInstaller);
{ Installers.Add(smtpproxyInstaller);
} }
}
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()
{
}
}