1
0
mirror of https://github.com/bitwarden/directory-connector synced 2025-12-21 18:53:18 +00:00

install tweaks

This commit is contained in:
Kyle Spearrin
2017-05-16 13:35:55 -04:00
parent 89f16609dd
commit 7f332986de
3 changed files with 74 additions and 2 deletions

View File

@@ -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");
}
}
}
}