-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBethesdaLauncher.cs
More file actions
32 lines (27 loc) · 836 Bytes
/
BethesdaLauncher.cs
File metadata and controls
32 lines (27 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using Microsoft.Win32;
using System.Diagnostics;
using System.Linq;
namespace Fallout76Proxy
{
static class BethesdaLauncher
{
public static bool Installed()
{
RegistryKey bethesdaNet = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Classes\\BethesdaNet\\Shell\\Open\\Command");
return bethesdaNet != null;
}
public static void Start(int GameIdx)
{
Process.Start($"bethesdanet://run/{GameIdx}");
}
public static void Stop()
{
foreach (Process bethesdaLauncher in Process.GetProcessesByName("BethesdaNetLauncher"))
bethesdaLauncher.Kill();
}
public static bool Active()
{
return Process.GetProcessesByName("BethesdaNetLauncher").Count() > 0;
}
}
}