Entfernen ProjctInstaller etc

This commit is contained in:
Developer01 2025-10-02 17:10:19 +02:00
parent 67ee7e6d3f
commit bc14644a5f
3 changed files with 6 additions and 28 deletions

View File

@ -43,6 +43,8 @@
<PackageReference Include="CoreWCF.Http" Version="1.8.0" /> <PackageReference Include="CoreWCF.Http" Version="1.8.0" />
<PackageReference Include="CoreWCF.WebHttp" Version="1.8.0" /> <PackageReference Include="CoreWCF.WebHttp" Version="1.8.0" />
<PackageReference Include="CoreWCF.NetTcp" Version="1.8.0" /> <PackageReference Include="CoreWCF.NetTcp" Version="1.8.0" />
<PackageReference Include="System.DirectoryServices" Version="9.0.9" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="9.0.9" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,24 +0,0 @@
Imports System.ComponentModel
Imports System.Configuration.Install
Imports System.ServiceProcess
<RunInstaller(True)>
Public Class ProjectInstaller
Inherits Installer
Private ReadOnly process As ServiceProcessInstaller
Private ReadOnly components As IContainer
Private ReadOnly service As ServiceInstaller
Public Sub New()
process = New ServiceProcessInstaller With {
.Account = ServiceAccount.LocalSystem
}
service = New ServiceInstaller With {
.ServiceName = Constants.SERVICE_NAME,
.DisplayName = Constants.SERVICE_DISPLAY_NAME
}
Installers.Add(process)
Installers.Add(service)
End Sub
End Class

View File

@ -9,10 +9,10 @@ Public Class ZUGFeRDService
Private Logger As Logger Private Logger As Logger
Private ThreadRunner As ThreadRunner Private ThreadRunner As ThreadRunner
Protected Sub OnStart(args() As String) Protected Overrides Sub OnStart(args() As String)
Try Try
LogConfig = New LogConfig(PathType.CustomPath, Path.Combine(My.Application.Info.DirectoryPath, "Log"), Nothing, "Digital Data", "DDZUGFeRDService") LogConfig = New LogConfig(PathType.CustomPath, Path.Combine(AppContext.BaseDirectory, "Log"), Nothing, "Digital Data", "DDZUGFeRDService")
Dim oConfig = New ConfigManager(Of Config)(LogConfig, My.Application.Info.DirectoryPath) Dim oConfig = New ConfigManager(Of Config)(LogConfig, AppContext.BaseDirectory)
LogConfig.Debug = oConfig.Config.Debug LogConfig.Debug = oConfig.Config.Debug
Logger = LogConfig.GetLogger() Logger = LogConfig.GetLogger()
Logger.Info($"{Constants.SERVICE_NAME} is starting.") Logger.Info($"{Constants.SERVICE_NAME} is starting.")
@ -37,7 +37,7 @@ Public Class ZUGFeRDService
End Try End Try
End Sub End Sub
Protected Sub OnStop() Protected Overrides Sub OnStop()
Logger.Info($"{Constants.SERVICE_NAME} is stopping.") Logger.Info($"{Constants.SERVICE_NAME} is stopping.")
ThreadRunner.Stop() ThreadRunner.Stop()
Logger.Info($"{Constants.SERVICE_NAME} stopped.") Logger.Info($"{Constants.SERVICE_NAME} stopped.")