0
0
mirror of https://github.com/sp-tarkov/launcher.git synced 2025-02-13 04:50:44 -05:00

47 lines
1.3 KiB
C#
Raw Normal View History

2023-03-03 19:25:33 +00:00
using Microsoft.Win32;
using System.IO;
2024-05-21 20:15:19 +01:00
namespace SPT.Launcher.Helpers
2023-03-03 19:25:33 +00:00
{
public static class ValidationUtil
{
public static bool Validate()
{
var c0 = @"Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\EscapeFromTarkov";
var v0 = 0;
try
{
2023-12-19 14:00:26 -05:00
var v1 = Registry.LocalMachine.OpenSubKey(c0, false).GetValue("InstallLocation");
2023-03-03 19:25:33 +00:00
var v2 = (v1 != null) ? v1.ToString() : string.Empty;
2023-12-19 14:00:26 -05:00
var v3 = new DirectoryInfo(v2);
var v4 = new FileSystemInfo[]
2023-03-03 19:25:33 +00:00
{
v3,
2023-12-19 14:00:26 -05:00
new FileInfo(Path.Join(v2, @"BattlEye\BEClient_x64.dll")),
new FileInfo(Path.Join(v2, @"BattlEye\BEService_x64.dll")),
new FileInfo(Path.Join(v2, "ConsistencyInfo")),
new FileInfo(Path.Join(v2, "Uninstall.exe")),
new FileInfo(Path.Join(v2, "UnityCrashHandler64.exe"))
2023-03-03 19:25:33 +00:00
};
v0 = v4.Length - 1;
foreach (var value in v4)
{
2023-12-19 14:00:26 -05:00
if (value.Exists)
2023-03-03 19:25:33 +00:00
{
--v0;
}
}
}
catch
{
v0 = -1;
}
return v0 == 0;
}
}
}