Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vcrun2015 / vcrun2017] ucrtbase.dll not getting installed properly #1635

Closed
MadByteDE opened this issue Oct 19, 2020 · 6 comments · Fixed by #1669
Closed

[vcrun2015 / vcrun2017] ucrtbase.dll not getting installed properly #1635

MadByteDE opened this issue Oct 19, 2020 · 6 comments · Fixed by #1669

Comments

@MadByteDE
Copy link

MadByteDE commented Oct 19, 2020

Hey,

The issue has been found using the latest winetricks version (61509663b824d72daafec6a95986e5b256e19e0e8ec1d2b7c4e89cf52665d63b).

We tried to find the cause for a crash in Foundation over at the Proton issue tracker. After some tinkering & a tip by @gverm it became clear that there is an issue with the vcrun2015 & vcrun2017 installers not properly replacing the ucrtbase.dll due to issues with the file permission. There is no hint in the log that the file couldn't be replaced properly.

This recently removed workaround for wine bug 30713 (via #1631 ) fixed the issue for some users by manually copy/pasting the dlls into the prefix system32 directory, but it didn't work for everyone.

A manual workaround for Foundation is described here.

Since proton automatically installs vcrun2015 into the game prefix and the game still crashes, I assumed that the vcrun2015 installer has to be affected as well.

@Vavooon
Copy link

Vavooon commented Oct 19, 2020

In my particular case the target file is a symbolic link to /home/vavooon/.local/share/Steam/steamapps/common/Proton 5.13/dist/lib64/wine/fakedlls/ucrtbase.dll and cp fails while trying to follow the link and override read-only file.

I don't really know a cp flag which just overrides the link but if we remove it it would completely solve the issue. Not sure whether it's required for other files though.

diff --git a/winetricks b/usr/bin/winetricks
index 2dc1fd8..97c36ec 100755
--- a/winetricks
+++ b/usr/bin/winetricks
@@ -12724,6 +12724,7 @@ load_vcrun2017()
                 cp "${W_TMP}"/api_ms_win_crt_math_l1_1_0.dll "${W_SYSTEM64_DLLS}"/api-ms-win-crt-math-l1-1-0.dll
                 cp "${W_TMP}"/api_ms_win_crt_runtime_l1_1_0.dll "${W_SYSTEM64_DLLS}"/api-ms-win-crt-runtime-l1-1-0.dll
                 cp "${W_TMP}"/api_ms_win_crt_stdio_l1_1_0.dll "${W_SYSTEM64_DLLS}"/api-ms-win-crt-stdio-l1-1-0.dll
+                rm "${W_SYSTEM64_DLLS}"/ucrtbase.dll
                 cp "${W_TMP}"/ucrtbase.dll "${W_SYSTEM64_DLLS}"/ucrtbase.dll
             else
                 w_try "${WINE}" vc_redist.x64.exe ${W_OPT_UNATTENDED:+/q}

@gverm
Copy link
Contributor

gverm commented Oct 19, 2020

We probably need to remove the wine dlls so that the installer can install them properly. Also, the fact this game doesn't work with wine's ucrtbase.dll is also a bug. Could you please report this on bugs.winehq.org?

EDIT: I'll try to work on the winetricks part soon.

@MadByteDE
Copy link
Author

@gverm I just searched for similar cases on bugs.winehq.org and found this and the statement from 2018:

(In reply to Brendan McGrath from comment #0)
> Therefore I was able to resolve this by changing the version in
> dlls/ucrtbase/version.rc to 10.0.1.0. Proposed patch is attached.

This doesn't seem sustainable. IIRC I've seen at least one application that requires an actually higher version than we currently report. I think the better solution is just to remove builtin ucrtbase before installing native.

The reported version might not be of any interest, but in the second part the dev suggested, as I understand it, to remove the builtin dll anyway when installing the native dll via vcrun installer. Maybe I misunderstand it, though.

@Vavooon If you don't mind I'd suggest that you open the bug report on bugs.winehq.org if still needed? You seem to be a better candidate for that. 😉

@gverm
Copy link
Contributor

gverm commented Oct 19, 2020

@MadByteDE Yeah, I think the installer not replacing ucrtbase will be a WONTFIX on the wine side. But removing the builtin dlls before installing native should work fine, I'll send a PR soon.

About the actual wine bug: I meant reporting a bug for this game because it won't work without installing vcrun. This should not be the case and wine should be fixed accordingly.

@Vavooon
Copy link

Vavooon commented Oct 19, 2020

@MadByteDE Sure, here it is https://bugs.winehq.org/show_bug.cgi?id=50031

Anyways, I'm wondering what's the actual issue. Is ucrtbase from VC_redist just a newer library version?
I see 3 possible cases here then:

  1. Foundation doesn't check library version, then it's Foundation issue
  2. Foundation checks it, but reported version is high enough to suggest that some feature is available, then it's wine issue
  3. Foundation checks for VC2015/2017 availability and since it is already installed by Steam (but again, file is not overridden), it thinks that correct version is available, then it's wine issue again, since it prevents file to be overridden.

Or maybe it's the case at all, I only have some knowledge about how libraries on Linux work.

@gverm
Copy link
Contributor

gverm commented Oct 19, 2020

@Vavooon There are multiple issues:

  1. The VC2015/VC2017 detects that a newer ucrtbase.dll is installed (because wine's ucrtbase.dll has a higher version number, see the bug report @MadByteDE linked, this is a WONTFIX for wine, but can be worked around in winetricks)
  2. There's an issue with wine's ucrtbase.dll that causes The Foundation to malfunction.

Anyways, let's refrain from discussing this more, the issue has been narrowed down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants