mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-21 18:53:18 +00:00
install tweaks
This commit is contained in:
@@ -6,6 +6,7 @@ using System.ServiceProcess;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Configuration.Install;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Service
|
||||
{
|
||||
@@ -31,8 +32,10 @@ namespace Service
|
||||
|
||||
_serviceProcessInstaller.Account = ServiceAccount.LocalSystem;
|
||||
_serviceProcessInstaller.AfterInstall += new InstallEventHandler(AfterInstalled);
|
||||
_serviceProcessInstaller.BeforeInstall += new InstallEventHandler(BeforeInstalled);
|
||||
|
||||
_serviceInstaller.ServiceName = "bitwarden Directory Connector";
|
||||
_serviceInstaller.Description = "Sync directory groups and users to your bitwarden organization.";
|
||||
Installers.AddRange(new System.Configuration.Install.Installer[] { _serviceProcessInstaller, _serviceInstaller });
|
||||
}
|
||||
|
||||
@@ -40,5 +43,18 @@ namespace Service
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void BeforeInstalled(object sender, InstallEventArgs e)
|
||||
{
|
||||
if(EventLog.SourceExists(_serviceInstaller.ServiceName))
|
||||
{
|
||||
EventLog.DeleteEventSource(_serviceInstaller.ServiceName);
|
||||
}
|
||||
|
||||
if(EventLog.Exists("bitwarden"))
|
||||
{
|
||||
EventLog.Delete("bitwarden");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user