Fix services?

This commit is contained in:
John Gross
2019-08-31 23:25:05 -07:00
parent 997a3ca31c
commit 6680b0adb2
3 changed files with 9 additions and 6 deletions

View File

@@ -63,7 +63,7 @@ namespace Torch.Server
// Breaks on Windows Server 2019
if (!new ComputerInfo().OSFullName.Contains("Server 2019") && !Environment.UserInteractive)
{
using (var service = new TorchService())
using (var service = new TorchService(args))
ServiceBase.Run(service);
return;
}

View File

@@ -15,9 +15,11 @@ namespace Torch.Server
public const string Name = "Torch (SEDS)";
private TorchServer _server;
private Initializer _initializer;
private string[] _args;
public TorchService()
public TorchService(string[] args)
{
_args = args;
var workingDir = new FileInfo(typeof(TorchService).Assembly.Location).Directory.ToString();
Directory.SetCurrentDirectory(workingDir);
_initializer = new Initializer(workingDir);
@@ -29,11 +31,11 @@ namespace Torch.Server
}
/// <inheritdoc />
protected override void OnStart(string[] args)
protected override void OnStart(string[] _)
{
base.OnStart(args);
base.OnStart(_args);
_initializer.Initialize(args);
_initializer.Initialize(_args);
_initializer.Run();
}