Only disable service mode on Windows Server 2019

This commit is contained in:
John Gross
2019-07-11 23:35:24 -07:00
parent fd4b49e0d5
commit f4399d441d
2 changed files with 5 additions and 3 deletions

View File

@@ -8,6 +8,7 @@ using System.Reflection;
using System.ServiceProcess;
using System.Text;
using System.Threading;
using Microsoft.VisualBasic.Devices;
using NLog;
using NLog.Fluent;
using NLog.Targets;
@@ -59,13 +60,13 @@ namespace Torch.Server
return;
}
/* Breaks on Windows Server 2019 and we don't fully support services anyway
if (!Environment.UserInteractive)
// Breaks on Windows Server 2019
if (!new ComputerInfo().OSFullName.Contains("Server 2019") && !Environment.UserInteractive)
{
using (var service = new TorchService())
ServiceBase.Run(service);
return;
}*/
}
var initializer = new Initializer(workingDir);
if (!initializer.Initialize(args))