first commit

This commit is contained in:
2025-07-06 00:23:46 +02:00
commit 38f50c8819
1788 changed files with 112878 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
using System.IO;
using System.Runtime.InteropServices;
namespace NitroxModel.Discovery;
public static class GameInstallationHelper
{
public static bool HasGameExecutable(string path, GameInfo gameInfo)
{
if (string.IsNullOrWhiteSpace(path))
{
return false;
}
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
return File.Exists(Path.Combine(path, "MacOS", gameInfo.ExeName));
}
return File.Exists(Path.Combine(path, gameInfo.ExeName));
}
public static bool HasValidGameFolder(string path, GameInfo gameInfo)
{
if (string.IsNullOrWhiteSpace(path))
{
return false;
}
if (!Directory.Exists(path))
{
return false;
}
if (!HasGameExecutable(path, gameInfo))
{
return false;
}
if (!Directory.Exists(Path.Combine(path, gameInfo.DataFolder, "Managed")))
{
return false;
}
return true;
}
}