Cleaned & Updated ProjectInstaller.cs

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

View File

@@ -2,47 +2,31 @@ 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)]
public class ProjectInstaller : Installer
{ {
private ServiceInstaller smtpproxyInstaller; [RunInstaller(true)]
public class ProjectInstaller : Installer
{
private readonly ServiceProcessInstaller processInstaller;
private readonly ServiceInstaller smtpproxyInstaller;
private ServiceProcessInstaller processInstaller; public ProjectInstaller()
{
processInstaller = new ServiceProcessInstaller
{
Account = ServiceAccount.NetworkService
};
private IContainer components; 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."
};
public ProjectInstaller() Installers.Add(processInstaller);
{ Installers.Add(smtpproxyInstaller);
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()
{
}
} }