Fixed: Windows Installer hanging on removing previous service

pull/6013/head
Mark McDowall 1 year ago
parent 060be6177a
commit 76f5b26322

@ -54,6 +54,7 @@ namespace NzbDrone.Host
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
var appMode = GetApplicationMode(startupContext); var appMode = GetApplicationMode(startupContext);
var config = GetConfiguration(startupContext);
switch (appMode) switch (appMode)
{ {
@ -82,12 +83,22 @@ namespace NzbDrone.Host
// Utility mode // Utility mode
default: default:
{ {
new Container(rules => rules.WithNzbDroneRules()) new HostBuilder()
.AutoAddServices(ASSEMBLIES) .UseServiceProviderFactory(new DryIocServiceProviderFactory(new Container(rules => rules.WithNzbDroneRules())))
.ConfigureContainer<IContainer>(c =>
{
c.AutoAddServices(Bootstrap.ASSEMBLIES)
.AddNzbDroneLogger() .AddNzbDroneLogger()
.AddDatabase()
.AddStartupContext(startupContext) .AddStartupContext(startupContext)
.Resolve<UtilityModeRouter>() .Resolve<UtilityModeRouter>()
.Route(appMode); .Route(appMode);
})
.ConfigureServices(services =>
{
services.Configure<PostgresOptions>(config.GetSection("Radarr:Postgres"));
}).Build();
break; break;
} }
} }

Loading…
Cancel
Save