Skip to content

Commit

Permalink
Fixed modloader version check on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
thesupersonic16 committed Oct 12, 2024
1 parent 456f8ba commit 8ecde8f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions HedgeModManager/HedgeApp.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ public static void Main(string[] args)
if (CurrentCulture != null)
LoadLanguage(CurrentCulture.FileName);
CountLanguages();
if (IsLinux)
Linux.PatchHMMRegistry();
#if DEBUG
// Find a Steam Game
GameInstalls = GameInstall.SearchForGames(nameof(Games.SonicGenerations));
Expand Down
24 changes: 23 additions & 1 deletion HedgeModManager/Linux.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
Expand All @@ -13,6 +14,27 @@ namespace HedgeModManager
public static class Linux
{

/// <summary>
/// Performs any patches needed to let HedgeModManager to operate correctly
/// </summary>
/// <returns></returns>
public static bool PatchHMMRegistry()
{
var regCurrentUser = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Default);
if (regCurrentUser != null)
{
var dllOverrides = regCurrentUser.CreateSubKey("Software\\Wine\\DllOverrides");

if (dllOverrides != null)
{
dllOverrides.SetValue("d3d11", "native,builtin");
dllOverrides.SetValue("dinput8", "native,builtin");
}
}

return true;
}

/// <summary>
/// Performs any patches needed for mods to execute correctly
/// </summary>
Expand Down

0 comments on commit 8ecde8f

Please sign in to comment.