AntonioDePau / KHPCPatchManager

A tool based on OpenKH to allow modders and users to easily mod the PC release of the Kingdom Hearts collection
Apache License 2.0
54 stars 13 forks source link

Error when using Lutris through Wine (Linux) #38

Open AntonioDePau opened 10 months ago

AntonioDePau commented 10 months ago

Lutris is a Linux game manager that has integrations with Wine and several game services like Steam. https://en.wikipedia.org/wiki/Lutris

Here's my output using the latest with .NET 4.0, 4.5, and 4.8, and .NET 5.0 runtime from here installed. (Pretty sure the "fixme" lines can be ignored.)

wine KHPCPatchManager.exe
002c:fixme:winediag:loader_init wine-staging 8.18 is a testing version containing experimental patches.
002c:fixme:winediag:loader_init Please mention your exact version when filing bug reports on winehq.org.
0098:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0098:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0098:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0098:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0098:fixme:wineusb:query_id Unhandled ID query type 0x5.
0098:fixme:wineusb:query_id Unhandled ID query type 0x5.
0098:fixme:wineusb:query_id Unhandled ID query type 0x5.
0098:fixme:wineusb:query_id Unhandled ID query type 0x5.
0098:fixme:wineusb:query_id Unhandled ID query type 0x5.
012c:err:module:fixup_imports_ilonly mscoree.dll not found, IL-only binary L"KHPCPatchManager.exe" cannot be loaded
012c:err:module:loader_init Importing dlls for L"Z:\\home\\sleetixia\\Downloads\\KHPCPatchManager.exe" failed, status c0000135

I'm not sure if there's a winetricks thing I'm missing, but I thought the dotnet ones should have covered it. I get the same error when running in Wine with Mono.

And double-clicking should work just fine for opening graphical programs. It generally works fine for Windows executables run through Wine too as long as they don't have any errors.

Originally posted by @RoseIlanga in https://github.com/AntonioDePau/KHPCPatchManager/issues/37#issuecomment-1782917575

AntonioDePau commented 10 months ago

Hey, I don't know much about Linux, so I don't think I'll be able to help much with this, but I'll try.

The error log mentions the following, it's worth Googling it and checking if there are any fixes: 012c:err:module:fixup_imports_ilonly mscoree.dll not found

Found this for now: https://www.reddit.com/r/winehq/comments/eqx1uu/wine_doesnt_see_mscoreedll/

For me, a repair of dotnet would not fix it, had to run the uninstaller via "wine uninstaller" and then re-install dot net via "winetricks -force dotnet". I would say try the repair option first anyway though. Using the "wine uninstaller" wizard should prompt to repair or remove.

Try that and let me know how it goes.

But to be honest, I don't think the issue is KHPCPatchManager related and seems to be obviously tied to Linux/Wine/Lutris. So yeah, have a look on the internet regarding that error I quoted. Let me know what you find and I'll try and help from there.

RoseIlanga commented 10 months ago

Oh, sorry. I should have said I was running directly through Wine, not Lutris.

I've tried searching for what fixes I can, but none of them have worked for me so far. I can't imagine I'm doing anything wrong, since I'm testing with a clean Wine prefix and installing .NET stuff in it.

For some reason, none of the .NET installers are installing mscoree.dll into the system32 and syswow64 directories, so programs aren't finding it and then fail.

AntonioDePau commented 10 months ago

Regarding this:

I'm not sure if there's a winetricks thing I'm missing, but I thought the dotnet ones should have covered it. I get the same error when running in Wine with Mono.

Are you sure the error message when using Wine with Mono is 100% the same?

Have you seen the last reply to this thread: https://forum.winehq.org/viewtopic.php?p=136376&sid=c46a649c0cb3ad29e070c661c34fc253#p136376

You can also replace Wine-Mono with .Net from Microsoft. This can be done easily with winetricks.

Have you tried that?

RoseIlanga commented 10 months ago

I guess I misremembered. It's not the same.

wine KHPCPatchManager.exe
002c:fixme:winediag:loader_init wine-staging 8.18 is a testing version containing experimental patches.
002c:fixme:winediag:loader_init Please mention your exact version when filing bug reports on winehq.org.
0080:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0080:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0080:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0080:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0080:fixme:wineusb:query_id Unhandled ID query type 0x5.
0080:fixme:wineusb:query_id Unhandled ID query type 0x5.
0080:fixme:wineusb:query_id Unhandled ID query type 0x5.
0080:fixme:wineusb:query_id Unhandled ID query type 0x5.
0080:fixme:wineusb:query_id Unhandled ID query type 0x5.
012c:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
* Assertion at /vagrant/mono/mono/metadata/object.c:4677, condition `is_ok (error)' not met, function:prepare_
run_main, Could not load type of field 'KHPCPatchManager:ZipFiles' (12) due to: Could not load file or assembl
y 'DotNetZip, Version=1.15.0.0, Culture=neutral, PublicKeyToken=6583c7c814667745' or one of its dependencies. 
assembly:Z:\home\sleetixia\Downloads\KHPCPatchManager.exe type:KHPCPatchManager member:(null)

012c:err:mscoree:expect_no_runtimes Process exited with a Mono runtime loaded.

I don't know if Mono implements .NET 5.0+, though, so that might be the problem when it comes to running it through Mono.

I haven't looked at that thread specifically but I've already done that. I did winetricks dotnet40 dotnet452 dotnet48, which automatically removes Mono if it's installed (it shouldn't have been in this case), and then manually installed .NET 5.0 from the installers on Microsoft's website.

AntonioDePau commented 10 months ago

condition `isok (error)' not met, function:prepare run_main, Could not load type of field 'KHPCPatchManager:ZipFiles' (12) due to: Could not load file or assembl y 'DotNetZip, Version=1.15.0.0, Culture=neutral, PublicKeyToken=6583c7c814667745' or one of its dependencies.

Okay, so your issue is with DotNetZip specifically. This is the one that handles .khpcpatchfiles, which are just compressed archives. I have no idea how to make that work in your case though... But it doesn't seem like it's an issue with .NET's version.

The error message also indicates that it could be one of DotNetZip dependencies being the issue. You can check them here: https://www.nuget.org/packages/DotNetZip/#dependencies-body-tab

Which version of KHPCPatchManager have you been trying? I suggest you download and try with version 1.1.5: https://github.com/AntonioDePau/KHPCPatchManager/releases/tag/v1.1.5

Do you have Discord? Add me (antoniodepau) if possible and I'll try and send you a custom made version to see if we can solve this.

RoseIlanga commented 10 months ago

Huh, I wonder why...

How would I check problems with the dependencies on the compiled executable?

I've been using the latest version, 1.2.0, but I can try with 1.1.5.

Yeah, I have Discord. I'll add you later after some sleep and hopefully we can figure something out.

Raflos10 commented 2 months ago

I was able to solve this issue for myself by downloading https://www.nuget.org/packages/DotNetZip/1.15.0 Extract lib/net40/DotNetZip.dll and put it in the same directory as the patch manager.

NeverBetterGT23 commented 2 months ago

I wanted to ask, though I doubt it; Are there any plans to make a Linux version of this app? I don't have a steam deck yet, but I plan to buy a used one soon and would like to be able to run mods on that version just like I do on Windows.