bottlesdevs / Bottles

Run Windows software and games on Linux
https://usebottles.com
GNU General Public License v3.0
6.34k stars 266 forks source link

[BUG] We should register every DLL with `*` asterisk at the start #1136

Open Arcitec opened 2 years ago

Arcitec commented 2 years ago

Great news for Bottles compatibility with games!

I discovered why Winetricks adds * asterisk before every DLL name, such as *d3dcompiler_43 etc.

It was explained in their source code here:

https://github.com/Winetricks/winetricks/blob/d431b15fa55667217571a791074dc3eb69155dfc/src/winetricks#L2115-L2122

Relevant part:

# Note: if you want to override even DLLs loaded with an absolute
# path, you need to add an asterisk:
echo "\"*${module}\"=\"${_W_mode}\"" >> "${W_TMP}"/override-dll.reg

What this means is, if Bottles installs dxgi.dll, and registers dxgi in Wine, the following happens:

If we register it as *dxgi instead, then it will always be loaded. In other words, the * asterisk is necessary to do a "full override".

If we don't override completely, then certain games and apps will break in Bottles since they won't load the overridden DLLs at all unless we add a * to the name.

This may explain a bunch of games that crash in Bottles (with null-pointer errors) but work in Lutris even with the exact same Wine-runner in both apps.

This post is a followup from comments here: https://github.com/bottlesdevs/Bottles/issues/1020#issuecomment-1061928764

mirkobrombin commented 2 years ago

I want to test this on my self before committing. Should not be a breaking thing