-
Notifications
You must be signed in to change notification settings - Fork 1
/
ArmA.cs
38 lines (35 loc) · 1.17 KB
/
ArmA.cs
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
33
34
35
36
37
38
using Microsoft.Win32;
namespace BSU.Sync
{
public static class ArmA
{
/// <summary>
/// Determines if ArmA is installed
/// </summary>
/// <returns></returns>
public static bool IsInstalled()
{
return ArmALocation() != string.Empty;
}
/// <summary>
/// Determines the location of ArmA
/// </summary>
/// <returns></returns>
public static string ArmALocation()
{
RegistryKey localKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64);
localKey = localKey.OpenSubKey(@"SOFTWARE\Bohemia Interactive\ArmA 3");
if (localKey != null)
{
return localKey.GetValue("main").ToString();
}
RegistryKey localkey32 = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32);
localkey32 = localkey32.OpenSubKey(@"SOFTWARE\Bohemia Interactive\ArmA 3");
if (localkey32 != null)
{
return localkey32.GetValue("main").ToString();
}
return string.Empty;
}
}
}