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

Windows build/freeze: Missing DLL points to the incorrect download page #147

Open
cfaester opened this issue Sep 16, 2019 · 10 comments
Open

Comments

@cfaester
Copy link

As per:

def _add_missing_dlls():
for dll_name in (
'msvcr100.dll', 'msvcr110.dll', 'msvcp110.dll', 'vcruntime140.dll',
'msvcp140.dll', 'concrt140.dll', 'vccorlib140.dll'
):
try:
_add_missing_dll(dll_name)
except LookupError:
raise FileNotFoundError(
"Could not find %s on your PATH. Please install the Visual C++ "
"Redistributable for Visual Studio 2012 from:\n "
"https://www.microsoft.com/en-us/download/details.aspx?id=30679"
% dll_name

Missing DLL's for redist 2010, 2012, and 2015 points the user to download only the 2012 version.
MSVCR100 refers to 2010.
MSVCR110 is 2012.
MSVCR140 is 2015

Apologies for no PR. I am not a Python programmer.

@charlieman
Copy link

I just had a similar problem in Windows 10. Trying the redistributable from that link just gave an error saying I had a newer version. Then I installed the redistributable 2015-2019 from this page: https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads which seems to always point to the latest one so it might be a better link.

But my problem was with the api-ms-win-crt-multibyte-l1-1-0.dll file missing and I couldn't find it anywhere after installing the redistributable. Ultimately, I copied it from my fman install into the target/project folder for freeze to work.

@stevenbedrick
Copy link

Just to chime in, I'm having the same msvcr100.dll problem (on a fresh install of Windows 10), and installing the 2015-2019 package does not seem to help. It ended up putting a bunch of other msvcr*.dll files in c:\Windows\System32\, including one called msvcr100_clr0400.dll, but not msvcr100.dll. Just for fun, I also tried installing the various other packages from that MSDN page (e.g., the MSVC 2012 redistributable packages, etc.) and at the end of the process still didn't have a copy of that DLL anywhere that I could see on %PATH%.

I'm by no means a Windows expert, but is there a particular reason that fbs freeze needs msvcr100.dll? From what I've been reading, it refers to a pretty old version of the MSVC runtime- is it actually needed in this day and age?

@mherrmann
Copy link
Owner

@stevenbedrick you could try to remove the msvcr*.dll lines in your venv/lib/site-packages/fbs/fbs/freeze/windows.py file and see if it still works.

@stevenbedrick
Copy link

stevenbedrick commented Sep 23, 2020

Yup, I actually just commented out the call to _add_missing_dlls() and that seemed to do the trick- the resulting .exe file does run (at least on my Windows VM) and I was able to create an installer from it. No idea if it'll run anywhere else, yet- that's the next test. :-) But thanks!

So I guess my question at this point is what that function is doing, and if it's something that I might actually need at some point. My non-Windows-expert hunch is that perhaps on a naïve computer (i.e., one that doesn't have any of the visual studio stuff installed) I might expect to run into trouble running the resulting .exe, correct, since it doesn't include those DLLs and they presumably wouldn't be present on the system already?

@mherrmann
Copy link
Owner

The DLLs are simply required on some people's systems. But maybe it's just an issue with older Windows 7 versions.

@stevenbedrick
Copy link

Huh! Well, for now, it seems to be doing the trick, at least for my use case. Thanks so much for the reply and the help, and also for the really useful library! :-D

@AlfredThor
Copy link

I lost my job because of the DLL problem.

@meramsey
Copy link
Contributor

I know what your talking about here these dlls are hard to find and really should always be included for windows in
src/main/resources/windows

I had a few people on super old systems which had issues until i had all of the below files.
msvcr110.dll
msvcr100.dll
api-ms-win-crt-multibyte-l1-1-0.dll

Needed for older cpu and integrated gpus
libGLESv2.dll
libEGL.dll

Like it makes no sense why you would need ANGLE support but having the libEGL.dll was absolutely the only thing needed for those few edge cases and it has not caused any issues for the newer stuff.
https://forum.qt.io/topic/30957/where-is-libegl-dll/5

You should obviously find an official source for these files but in the off chance you cannot i have provided them here.

a few of these i found by grabbing other opensource projects compiled apps installing them and then checking installation path for these files and saving them.
windows-dlls.zip

Once you get the winning combination you can then check them into git and as long as there in src/main/resources/windows when you freeze they should always be included.

@mherrmann
Copy link
Owner

I had a few people on super old systems which had issues until i had all of the below files.
msvcr110.dll
msvcr100.dll
api-ms-win-crt-multibyte-l1-1-0.dll

That was my experience as well. That's why fbs adds them to the frozen binary.

I haven't yet had the need for libGLESv2.dll or libEGL.dll. @whattheserver do you think your experience was specific to your app, or would it be applicable to all fbs apps?

@meramsey
Copy link
Contributor

I had to dig through my notes but yeah i would say these should probably be in every app's windows version. I think the problem in my case was most apparent due the fact i heavily use QtWebengine and on older systems they may not have good OpenGL rendering or compatible dlls installed and these dlls are not like provided by Microsoft dev stuff or base install.

Qtwebengine and some of the other visual stuff which relies on:
QSurfaceFormat

Some context
pyinstaller/pyinstaller#4322
https://stackoverflow.com/questions/42810699/failed-to-locate-library-libglesv2-dll

https://www.riverbankcomputing.com/pipermail/pyqt/2020-February/042531.html

Install a driver providing OpenGL 2.0 or higher, or, if this is not
>>>> possible, make sure the ANGLE Open GL ES 2.0 emulation libraries
>>>> (libEGL.dll, libGLESv2.dll and d3dcompiler_*.dll) are available in 
>>>> the
>>>> application executable's directory or in a location listed in PATH.
>>> 
>>> All of those DLLs are included in the wheel.

I spent months jumping through hoops as have others trying to get QTwebengine based apps to compile and work uniformly across both old and new systems which may not have the same OpenGL drivers or graphics cards.

Note that the above is just the Windows side of the fix.


There is also some really weird Linux ones too where if i compiled on old ones things would fail on newer ones due to the libz thing or the linux OpenGL loading the wrong library or being incompatible with the wayland/mesa/nvidia drivers,

OpenGL
Some reference links if you feel like wandering that rabbithole lol
https://bugs.launchpad.net/ubuntu/+source/qtwebengine-opensource-src/+bug/1857121
https://doc.qt.io/qt-5/qtwebengine-debugging.html
https://stackoverflow.com/questions/34969990/kivy-does-not-detect-opengl-2-0
https://github.com/pal1000/save-legacy-intel-graphics
qutebrowser/qutebrowser#5490
https://docs.mesa3d.org/vmware-guest.html

the libz thing is also real issue which there was another open issue about i had commented on last year
#185

I know its alot of information but these are real common issues with pyinstaller which if accounted for in fbs would make things for newcomers without good debugging and research skills experience alot smoother :)

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

No branches or pull requests

6 participants