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))

View File

@@ -83,6 +83,7 @@
<HintPath>..\GameBinaries\Microsoft.CodeAnalysis.CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="Microsoft.Win32.Registry, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Win32.Registry.4.4.0\lib\net461\Microsoft.Win32.Registry.dll</HintPath>
</Reference>