From 072f100c563f0b747f13702ef65f17c5fe991942 Mon Sep 17 00:00:00 2001 From: IsWaffle Date: Tue, 19 Dec 2023 20:23:07 +0000 Subject: [PATCH] update game check (!44) Co-authored-by: waffle.lord Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Modules/pulls/44 Co-authored-by: IsWaffle Co-committed-by: IsWaffle --- project/Aki.Core/Utils/ValidationUtil.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/project/Aki.Core/Utils/ValidationUtil.cs b/project/Aki.Core/Utils/ValidationUtil.cs index 8cfece7..dac3609 100644 --- a/project/Aki.Core/Utils/ValidationUtil.cs +++ b/project/Aki.Core/Utils/ValidationUtil.cs @@ -14,20 +14,20 @@ namespace Aki.Core.Utils try { - var v1 = Registry.LocalMachine.OpenSubKey(c0, false).GetValue("UninstallString"); + var v1 = Registry.LocalMachine.OpenSubKey(c0, false).GetValue("InstallLocation"); var v2 = (v1 != null) ? v1.ToString() : string.Empty; - var v3 = new FileInfo(v2); + var v3 = new DirectoryInfo(v2); ServerLog.Debug("Aki.Core", v2); ServerLog.Debug("Aki.Core", string.IsNullOrEmpty(v2) ? "0" : v3.Length.ToString()); - - var v4 = new FileInfo[] + + var v4 = new FileSystemInfo[] { v3, - new FileInfo(v2.Replace(v3.Name, @"BattlEye\BEClient_x64.dll")), - new FileInfo(v2.Replace(v3.Name, @"BattlEye\BEService_x64.dll")), - new FileInfo(v2.Replace(v3.Name, @"ConsistencyInfo")), - new FileInfo(v2.Replace(v3.Name, @"Uninstall.exe")), - new FileInfo(v2.Replace(v3.Name, @"UnityCrashHandler64.exe")) + 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")) }; v0 = v4.Length - 1;