Cleaned & Updated ProjectInstaller.cs
This commit is contained in:
@@ -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)]
|
[RunInstaller(true)]
|
||||||
public class ProjectInstaller : Installer
|
public class ProjectInstaller : Installer
|
||||||
{
|
{
|
||||||
private ServiceInstaller smtpproxyInstaller;
|
private readonly ServiceProcessInstaller processInstaller;
|
||||||
|
private readonly ServiceInstaller smtpproxyInstaller;
|
||||||
private ServiceProcessInstaller processInstaller;
|
|
||||||
|
|
||||||
private IContainer components;
|
|
||||||
|
|
||||||
public ProjectInstaller()
|
public ProjectInstaller()
|
||||||
{
|
{
|
||||||
processInstaller = new ServiceProcessInstaller();
|
processInstaller = new ServiceProcessInstaller
|
||||||
InitializeComponent();
|
{
|
||||||
smtpproxyInstaller = new ServiceInstaller();
|
Account = ServiceAccount.NetworkService
|
||||||
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)
|
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."
|
||||||
|
};
|
||||||
|
|
||||||
private void serviceProcessInstaller1_AfterInstall(object sender, InstallEventArgs e)
|
Installers.Add(processInstaller);
|
||||||
{
|
Installers.Add(smtpproxyInstaller);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool disposing)
|
|
||||||
{
|
|
||||||
if (disposing && components != null)
|
|
||||||
{
|
|
||||||
components.Dispose();
|
|
||||||
}
|
|
||||||
base.Dispose(disposing);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user