mirror of
https://github.com/bitwarden/directory-connector
synced 2026-01-07 11:03:23 +00:00
service installer
This commit is contained in:
44
src/Service/Installer.cs
Normal file
44
src/Service/Installer.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.ServiceProcess;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Configuration.Install;
|
||||
|
||||
namespace Service
|
||||
{
|
||||
[RunInstaller(true)]
|
||||
[DesignerCategory("Code")]
|
||||
public class Installer : System.Configuration.Install.Installer
|
||||
{
|
||||
|
||||
private IContainer _components = null;
|
||||
private ServiceProcessInstaller _serviceProcessInstaller;
|
||||
private ServiceInstaller _serviceInstaller;
|
||||
|
||||
public Installer()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
private void Init()
|
||||
{
|
||||
_components = new Container();
|
||||
_serviceProcessInstaller = new ServiceProcessInstaller();
|
||||
_serviceInstaller = new ServiceInstaller();
|
||||
|
||||
_serviceProcessInstaller.Account = ServiceAccount.LocalSystem;
|
||||
_serviceProcessInstaller.AfterInstall += new InstallEventHandler(AfterInstalled);
|
||||
|
||||
_serviceInstaller.ServiceName = "bitwarden Directory Connector";
|
||||
Installers.AddRange(new System.Configuration.Install.Installer[] { _serviceProcessInstaller, _serviceInstaller });
|
||||
}
|
||||
|
||||
private void AfterInstalled(object sender, InstallEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33,6 +33,7 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration.Install" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
@@ -43,6 +44,7 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Installer.cs" />
|
||||
<Compile Include="Service.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user