rockerbacon / modorganizer2-linux-installer

An easy-to-use Mod Organizer 2 installer for Linux
GNU General Public License v3.0
903 stars 75 forks source link

FOMOD #C installer errors #446

Open TheRedBaron56 opened 1 year ago

TheRedBaron56 commented 1 year ago

Trying to use the built-in FOMOD installer raises the following error message:

[2023-01-24 12:10:40.433 W] C# [0]: Metadata fileSystem.Runtime.dll' could not be found [2023-01-24 12:10:40.441 E] QPixmap::fromWinHICON(), failed to GetIconInfo() (Invalid cursor handle.) [2023-01-24 12:10:40.442 E] QPixmap::fromWinHICON(), failed to GetIconInfo() (Invalid cursor handle.) [2023-01-24 12:10:40.443 E] QPixmap::fromWinHICON(), failed to GetIconInfo() (Invalid cursor handle.)`

Using Mint 20.3 Cinnamon version 5.2.7 on kernel 5.4.0-137-generic pls lmk if you need more information

ShagmanJohnson commented 1 year ago

I'm having the same issue let me know if you uncover a solution

blakie1225 commented 11 months ago

Also having this error

DownloadFreeloader commented 10 months ago

I am also having this issue attempting to install Helmet Overlay. This is the error that comes up when trying to install it normally:

[2023-08-17 02:58:09.165 W] C# [0]: Metadata file `System.Runtime.dll' could not be found
[2023-08-17 02:58:09.167 E] QPixmap::fromWinHICON(), failed to GetIconInfo() (Invalid cursor handle.)
[2023-08-17 02:58:09.167 E] QPixmap::fromWinHICON(), failed to GetIconInfo() (Invalid cursor handle.)
[2023-08-17 02:58:09.167 E] QPixmap::fromWinHICON(), failed to GetIconInfo() (Invalid cursor handle.)

Using the NCC install results in it installing incorrectly, with the mod containing nothing a but a meta.ini file.

mschmid98 commented 7 months ago

I figured out what the issue is. Essentially, MO2's fomod plugin refers to a missing dll for compilation of the mod's C# script. In wine-mono, which is used in Proton, the System.Runtime.dll is only present as a "facade dll" in a folder which is not in the search path. A proper fix would have to be done in the MO2 plugin but you can work around as follows:

  1. Go to the Proton installation directory for the version you use for MO2, for example <steam-path>/steamapps/common/Proton 8.0. Here, navigate to dist/share/wine/mono/wine-mono-<version>/lib/mono/4.5/ (\<version> is wine-mono's version, e.g. 8.0.1 for Proton 8.0).
  2. This is the folder where System.Runtime.dll is expected but does not exist. To work around the issue, create a symlink to "Facades/System.Runtime.dll. This is probably doable in the GUI but via the console, you can do this by running ln -s System.Runtime.dll Facades/System.Runtime.dll (open a terminal in this folder!)

This should generally get fomod scripts to work but I only tested this on my setup, so no guarantees.

Also, if you attempt to install MCM for New Vegas, there appears to be another issue with MCM's install script. I won't go into detail because it requires C# knowledge but it is fixable as follows:

  1. Extract "The Mod Configuration Menu.fomod" from the archive. Fomod's are themselves only archives, open it (e.g. with Ark on the deck) and extract "fomod/script.cs".
  2. Edit script.cs: In line 142 (as of version 1.5) where it says "static bool InstallFileFromFomod", insert a "new" between "static" and "bool", i.e. "static new bool InstallFileFromFomod".
  3. Save the file, replace it in the fomod and the replace the fomod file in the mod archive (essentially reverse step 1 with the edited script). Install MCM with the archive containing the edited script.
TheRedBaron56 commented 6 months ago

I figured out what the issue is. Essentially, MO2's fomod plugin refers to a missing dll for compilation of the mod's C# script. In wine-mono, which is used in Proton, the System.Runtime.dll is only present as a "facade dll" in a folder which is not in the search path. A proper fix would have to be done in the MO2 plugin but you can work around as follows:

1. Go to the Proton installation directory for the version you use for MO2, for example `<steam-path>/steamapps/common/Proton 8.0`. Here, navigate to `dist/share/wine/mono/wine-mono-<version>/lib/mono/4.5/` (<version> is wine-mono's version, e.g. 8.0.1 for Proton 8.0).

2. This is the folder where System.Runtime.dll is expected but does not exist. To work around the issue, create a symlink to "Facades/System.Runtime.dll. This is probably doable in the GUI but via the console, you can do this by running `ln -s  System.Runtime.dll Facades/System.Runtime.dll` (open a terminal in this folder!)

This should generally get fomod scripts to work but I only tested this on my setup, so no guarantees.

Also, if you attempt to install MCM for New Vegas, there appears to be another issue with MCM's install script. I won't go into detail because it requires C# knowledge but it is fixable as follows:

1. Extract "The Mod Configuration Menu.fomod" from the archive. Fomod's are themselves only archives, open it (e.g. with Ark on the deck) and extract "fomod/script.cs".

2. Edit script.cs: In line 142 (as of version 1.5) where it says "static bool InstallFileFromFomod", insert a "new" between "static" and "bool", i.e. "static new bool InstallFileFromFomod".

3. Save the file, replace it in the fomod and the replace the fomod file in the mod archive (essentially reverse step 1 with the edited script). Install MCM with the archive containing the edited script.

Tried this; didn't work for me. Got a different error message tho:

[2023-12-18 20:52:47.745 E] C# [13]: FieldScript.ModSubtitle' is never assigned to, and will always have its default value null' [2023-12-18 20:52:47.745 E] C# [61]: FieldScript.TimerFinished' is never assigned to, and will always have its default value null' [2023-12-18 20:52:47.745 E] C# [730]: FieldScript.Page.ClickedBack' is never assigned to, and will always have its default value null' [2023-12-18 20:52:47.745 E] C# [731]: FieldScript.Page.ClickedNext' is never assigned to, and will always have its default value null' [2023-12-18 20:52:47.746 E] C# [1750]: FieldScript.NavigationButton.DisabledColor' is never assigned to, and will always have its default value [2023-12-18 20:52:47.746 E] C# [1893]: Field Script.Option.CheckChanged' is never assigned to, and will always have its default valuenull' [2023-12-18 20:52:47.746 E] C# [1896]: Field Script.Option.MouseOver' is never assigned to, and will always have its default valuenull'`

mschmid98 commented 6 months ago

Well, I only tested this for Proton 8 and the MCM for New Vegas, I don't know which mod you attempted to install (and for which game and Proton version) but these errors at least show that the script was attempted to be compiled which was unsuccessful due to compiler errors. These errors are due to bad scripts (presence of unused variables), although these should only be warnings and not errors and thus not affect the compilation's success.

I looked up the plugin' source code and the issue is that the plugin treats warnings and errors in the same way (see here), hence the failure to install is the fault of MO2's C# fomod plugin which causes the install to fail even for only compiler warnings.

Ultimately this would have to be fixed in the plugin. As a workaround, you can fix the C# script of the mod, which mod did you use?

truexfan81 commented 1 month ago

the instructions allow the mod to install and enable but in game it's non-existent also with proton experimental i was not able to get a non broken symlink so i just ended up copying the dll file to the 4.5 directory

rintac commented 1 month ago

I just wanted to add that @mschmid98's solution worked for me, but the symlink syntax is incorrect in their comment. It should be ln -s source-file destination-file, in this instance ln -s Facades/System.Runtime.dll System.Runtime.dll.