[Enhancement]: Issues running Windows game on Linux with dotnet installed on Linux
samr7 opened this issue ยท 3 comments
Describe the new feature or enhancement
I followed the instructions for how to install MelonLoader v0.6.4 for a Windows game running under Steam Proton on Linux.
I had some problems, and would like to share my solution.
The main problem is that it failed to load hostfxr:
[ERROR] il2cpp_init detour failed: Failed to load hostfxr. Please make sure you have installed the .NET 6.0 runtime.
I definitely had the dotnetdesktop6 package installed per the instructions.
It turned out that it was failing because the Linux dotnet SDK was installed on the host, and it configures a system-wide environment variable, DOTNET_ROOT. This environment variable was being passed into the Proton Windows environment. The Windows dotnet host tool also uses this environment variable, and having it set, especially to a Linux host path, prevented it from finding its runtime.
In Steam, this environment variable can be cleared by setting launch options for the game:
DOTNET_ROOT= %command%
I don't think this should be fixed/enhanced in MelonLoader itself, but maybe it would help somebody else if it got into the instructions.
@samr7 Can you make a short step by step how to set the environment variable on Lutris or just using winetricks?
@ZanDev32 Are you also noticing this problem?
I am unfamiliar with Lutris.
I also don't know of a good way to do this using Wine built-in mechanisms or winetricks. It's possible to set environment variables in user.reg, but setting one to an empty string does not have the effect of removing or masking an existing environment variable.