Skip to content

Commit f4399d4

Browse files
committed
Only disable service mode on Windows Server 2019
1 parent fd4b49e commit f4399d4

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎Torch.Server/Program.cs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using System.ServiceProcess;
99
using System.Text;
1010
using System.Threading;
11+
using Microsoft.VisualBasic.Devices;
1112
using NLog;
1213
using NLog.Fluent;
1314
using NLog.Targets;
@@ -59,13 +60,13 @@ public static void Main(string[] args)
5960
return;
6061
}
6162

62-
/* Breaks on Windows Server 2019 and we don't fully support services anyway
63-
if (!Environment.UserInteractive)
63+
// Breaks on Windows Server 2019
64+
if (!new ComputerInfo().OSFullName.Contains("Server 2019") && !Environment.UserInteractive)
6465
{
6566
using (var service = new TorchService())
6667
ServiceBase.Run(service);
6768
return;
68-
}*/
69+
}
6970

7071
var initializer = new Initializer(workingDir);
7172
if (!initializer.Initialize(args))

‎Torch.Server/Torch.Server.csproj‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
<HintPath>..\GameBinaries\Microsoft.CodeAnalysis.CSharp.dll</HintPath>
8484
<Private>False</Private>
8585
</Reference>
86+
<Reference Include="Microsoft.VisualBasic" />
8687
<Reference Include="Microsoft.Win32.Registry, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
8788
<HintPath>..\packages\Microsoft.Win32.Registry.4.4.0\lib\net461\Microsoft.Win32.Registry.dll</HintPath>
8889
</Reference>

0 commit comments

Comments
 (0)