nike4613 / BeatSaber-IPA-Reloaded

A Unity mod injector built for Beat Saber.
https://nike4613.github.io/BeatSaber-IPA-Reloaded/
Other
180 stars 28 forks source link

winhttp.dll override breaks wine (with fix) #9

Closed Vash63 closed 5 years ago

Vash63 commented 5 years ago

I haven't had time to dig into this until recently, but an update a few weeks ago completely broke this in Wine whereas prior it worked perfectly. Anyway, I worked with a wine dev digging through logs and it turns out this was caused by the way the newer IPA hotloads winhttp.dll.

It can be fixed by adding a DLL override in winecfg for 'winhttp' to 'native,builtin'. I've made a .REG file that can just be run through regedit that does this automatically: https://github.com/Vash63/bsmodinstaller.py/blob/master/winhttp.reg

Also on that repo I'm hoping to get my mod installer working again (it relied heavily on modsaber) to make this a bit more automated.

tldr: Could you notate somewhere in the Readme or any FAQ that this winhttp override is necessary? It wasn't required with the old IPA and was an unexpected regression.

nike4613 commented 5 years ago

Keep in mind that linux is not officially supported by the game, nor this, and the fact that it works at all is a small miracle. That being said, someone already had this problem and found a fix, just like you. (#7)

In my mind, this is a problem with Wine not emulating how Windows searches for and loads DLLs, not an issue with BSIPA. I will still probably add a mention in the README, since this is now the 2nd time this has been brought up, but you should probably also mention it on the Wine repos/mailing list that injections like this one don't work properly by default.

Vash63 commented 5 years ago

Thanks. Most games on Steam work in Linux now, so not as miraculous as it may seem. Beat Saber in particular is on Steam's official whitelist as a Linux compatible 'out-of-thebox' game through Steam Play, so it makes sense that people would be testing with it.

Regarding the bug, wine is unlikely to change this as winhttp is a Microsoft provided DLL, so by default wine uses their own reverse engineered version of it. This override function that the registry change above does tells wine to ignore its internal copy (which is generally what you'd want to use as it's already made to work in wine). The only way I could think of to permanently fix this issue is if the application didn't use any DLLs that conflict with internal Windows ones (I'm assuming the winhttp.dll included in this package isn't the same as the one shipped with Windows proper in System32).

Basically unless there's some note to tell Linux users that your software doesn't work with the normal system winhttp, this issue will probably continue to come up indefinitely for other users, hence adding a mention in the README that the override is necessary would be helpful to others.

Edit: The new readme works great, thanks.