Thanks to visit codestin.com
Credit goes to github.com

Skip to content

VCRUNTIME140_1.dll was not found 1.9.1 #743

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

Closed
big610 opened this issue Oct 26, 2021 · 42 comments
Closed

VCRUNTIME140_1.dll was not found 1.9.1 #743

big610 opened this issue Oct 26, 2021 · 42 comments
Assignees
Labels

Comments

@big610
Copy link

big610 commented Oct 26, 2021

Attempting to open 1.9.1 Windows Portable, for me fails with: VCRUNTIME140_1.dll was not found.
I held back reporting, due to 1.9.0 W P working & my decision choice for running safely one Windows version behind; 20H2 instead of 21H1.
Today I was expecting Windows 10 21H2 to be released a week after Patch Tuesday, did not happen.
Due to users choosing multiple versions & Windows 11, I chose to inform you, first so you know;
then can determine what happened, choose to fix for compatibility for all, or just notate in release notes.
https://www.bleepingcomputer.com/tutorials/fix-missing-vcruntime140dll-dll-error-in-windows/
VCRUNTIME is on the user for running an older Visual C++ 2015 Redistributable.
But my situation I have 2017, not 2015. Thnx, for a much appreciated excellent program for Windows Portable & Mac.
ksnip_1 9 1   1 9 0

@big610 big610 added the bug label Oct 26, 2021
@DamirPorobic
Copy link
Member

You suspect that this will not work with newer version of windows? It might be related to #713 that we drop something that is required to run everywhere, need to look into that.

@antrrax
Copy link
Contributor

antrrax commented Oct 29, 2021

To work around this problem in the portable version of windows 10, I manually add these two dll's in the ksnip directory:

msvcp140_1.dll
vcruntime140_1.dll

That's how it works for me

@DamirPorobic
Copy link
Member

But that's not good to have to add some dlls manually, we should deliver what we need to run, though this will increase the package size by factor of 2 I think.

@antrrax
Copy link
Contributor

antrrax commented Oct 29, 2021

I'm not sure, but I think the microsoft dll's cannot be attached together with the program, you need to send a VCRedist_x64.exe installer with the program. But that doesn't make sense in a portable version, where the Windows user is not allowed to install programs.

https://docs.microsoft.com/en-us/cpp/windows/determining-which-dlls-to-redistribute?view=msvc-160

@DamirPorobic DamirPorobic self-assigned this Oct 30, 2021
@DamirPorobic
Copy link
Member

Just triggered a build with changed flags for windeployqt, which does the packaging for windows. Can someone test the package in 20min or so.

@antrrax if I recall correctly without this flag you get vc_redist.x64.exe packaged.

@antrrax
Copy link
Contributor

antrrax commented Oct 30, 2021

I did the test here on a virtual machine.
Windows 10 Pro
Version 1809 build 17763,107

Without installing vc_redist.x64.exe it will give error with as dll's. But installing the vc_redist.x64.exe included in the package, Ksnip worked correctly.

However, when these microsoft dll's are required, the distribution of the program is no longer portable. Since users without administrator permission will not be able to install vc_redist.x64.exe

@DamirPorobic
Copy link
Member

Nah, I don't like it that there must be something installed additionally. Is this also affecting the msi package or just the portable?
Need to google a bit around how other Qt application handle that.

@antrrax
Copy link
Contributor

antrrax commented Oct 30, 2021

I did the test with ksnip version .zip (Continuous build)

@antrrax
Copy link
Contributor

antrrax commented Oct 30, 2021

Now I tested the msi version of ksnip (Continuous build) on windows 10 and 11 in a virtual machine.

In both cases the .msi installer does not automatically install vc_redist.exe
Although the file is present in the ksnip installation directory.

Then the dll error appears when running ksnip

Windows 11 Pro x64
Versão 21H2 Build 22000.194

Windows 10 Pro x64
Versão 21H1 Build 19043.928

@DamirPorobic
Copy link
Member

@antrrax can you check if this was an issue with 1.9.0? If yes, this might be an issue that could be resolved by downgrading the Qt version.

@antrrax
Copy link
Contributor

antrrax commented Oct 31, 2021

I tested several previous versions of ksnip and they didn't work.

The problem is that 'Microsoft Visual C++ 2015-2019 Redistributable' (vcredist) is not a native Windows component.
If you install Windows and then install ksnip, this dll error will happen when opening ksnip. Because vcredist is not installed yet.

So you would need to add code in the installer to check if vcredist is already present otherwise, first install vcredist and then install ksnip.

How to: Install Prerequisites in Windows Installer Deployment
https://docs.microsoft.com/en-us/previous-versions/7eh4aaa5(v=vs.90)?redirectedfrom=MSDN

I'm not sure, but apparently msi doesn't have this pre-installation function:
https://developercommunity.visualstudio.com/t/installer-project-with-prerequisites-with-only-msi/602612

See the example of the sketchup 2017:
https://www.mediafire.com/file/cl1f1cth8jkcyys/sketchupmake-2017-2-2555-90783-pt-br-x64.exe/file

If you unzip the file 'sketchupmake-2017-2-2555-90783-en-us-x64.exe' you will see SketchUp2017-x64.msi and the prerequisite files

@dafanasiev
Copy link

Maybe use -MT instead -MTd? Its not so good (security, patches, etc.), but not so bad (no vcruntime dlls deps)....

Notes: cmake: MSVC_RUNTIME_LIBRARY or use CL env.

@DamirPorobic
Copy link
Member

Maybe use -MT instead -MTd? Its not so good (security, patches, etc.), but not so bad (no vcruntime dlls deps)....

Where are we using those flags?

@dafanasiev
Copy link

dafanasiev commented Nov 3, 2021

Where are we using those flags?

Sorry, I mean "Maybe use -MT instead -MD". cl.exe use /MD as default value, if none setup as I know.

cmake hide executed commands, but you can enable verbose logging

But first of all we need to check how binary deps (openssl and others) are build... dumpbin /DEPENDENTS can help or dependencywalker.

@dafanasiev
Copy link

OK, I recompile ksnip with some modifications (cmake build flags) and my version not references to VCRUNTIME140_1.dll:
ksnip_20211106-200015

BUT : now qt reference it:
ksnip_20211106-200343

Qt (in ksnip case) installed via aqtinstall as binary.

Next I'll try to use static qt build....
Note1: Ksnip on windows reference to QDbus, really need this on windows?

@DamirPorobic
Copy link
Member

@dafanasiev Thanks for looking into this, and yes, it's expected to be referenced by Qt as Qt is the one who needs it. But anyways, I think we need to package VCRUNTIME140_1.dll with ksnip. Probably just copying into the package directory for the portable might be enough, the MSI however might be more tricky.

@big610
Copy link
Author

big610 commented Nov 6, 2021

Many apps on Github, the devs do only for Windows a Portable. Perhaps you figure out the msi reasoning, then retire the msi. Nothing wrong being all Portable.

@DamirPorobic
Copy link
Member

I would like to keep the msi, it's a signed package that can be installed automatically, especially for companies relevant.

@DamirPorobic
Copy link
Member

Can someone test again? I've now added the two missing dlls directly to the zip package, does that fix the issue?

@DamirPorobic
Copy link
Member

Nevermind, it doesn't work with those two, either the dlls are wrong or it doesn't work like that in general. Let me try something else.

@DamirPorobic
Copy link
Member

DamirPorobic commented Nov 15, 2021

Ok, now the runtime is in the package, can you please test again?

@antrrax
Copy link
Contributor

antrrax commented Nov 15, 2021

Windows 11, virtual machine
Tested version 1.10 Build Time: Mon, 15 Nov 2021 07:48:17

msi version, displayed these dll error messages in sequence:

MSVCP140.dll
MSVCP140_1.dll
VCRUNTIME140.dll
MSVCP140.dll


zip version didn't work either

@DamirPorobic
Copy link
Member

I've added only MSVCP140.dll and VCRUNTIME140.dll to the zip package for now. What does the zip version say? What files are missing?

@antrrax
Copy link
Contributor

antrrax commented Nov 15, 2021

Windows 11, virtual machine
Tested version 1.10 Build Time: Mon, 15 Nov 2021 07:48:17
zip:
displays error that this dll is missing:
MSVCP140_1.dll


on another PC that I don't have access to at the moment, I just add these 2 dll's in version 1.91(zip) and that's enough:
msvcp140_1.dll
vcruntime140_1.dll

@DamirPorobic
Copy link
Member

Let's try adding just MSVCP140_1.dll and see if that works. If that is working, we could try removing all except msvcp140_1.dll and vcruntime140_1.dll and test again if that is enough?

@DamirPorobic
Copy link
Member

Ok, triggered a new build with the two XXX_1.dll files, should be up in 20min or so for testing (the zip package). Would be nice if you could test different combinations of those files, better to need less, reduces the package size.

@DamirPorobic
Copy link
Member

Ok, it's all in there now.

@antrrax
Copy link
Contributor

antrrax commented Nov 15, 2021

Windows 11, virtual machine
Build Time: Mon, 15 Nov 2021 12:52:52

zip - Presented the following error:
The application cannot launch correctly (0xc000007b). Click Ok to close the application

msi - same 4 dlls error messages

--

Tomorrow I do a test with the dlls I have on another PC and they already work on version 1.91

@DamirPorobic
Copy link
Member

Strange, ok, let me know what you have found out.

@antrrax
Copy link
Contributor

antrrax commented Nov 16, 2021

Windows 10
Build Time: Mon, 15 Nov 2021 22:11:27
zip version:

I think there is some conflict with your dll's.
Using these dll files I downloaded from the internet, ksnip works.

http://wikisend.com/download/129424/ksnip_dll.zip

@DamirPorobic
Copy link
Member

I didn't find vcruntime140_1.dll as 32bit version, only 64bit. Where did you find those dlls? Have you used 32 or 64 bit versions?

@DamirPorobic
Copy link
Member

Can you test again?

@DamirPorobic
Copy link
Member

Add e new version, now with additionally the files without _1. Let's try that again.

@antrrax
Copy link
Contributor

antrrax commented Nov 21, 2021

I tested the zip version
Build Time: Sub, 21 Nov 2021 16:31:28

In virtual machine, now works on both windows 10 and windows 11

@DamirPorobic
Copy link
Member

Very good. I'm just wondering a bit that user @carloscadux reported that the MSI package is now working properly too but I haven't done anything there yet, can someone check the MSI package quickly before I copy the dlls there too?

@antrrax
Copy link
Contributor

antrrax commented Nov 22, 2021

I tested the msi version
Build Time: Mon, 22 Nov 2021 07:59:34

On a virtual machine with windows 10, it still didn't work

@DamirPorobic
Copy link
Member

Thanks, I'll try to add those missing files to the MSI next. I'll let you know when I've added them.

@carloscadux
Copy link

Very good. I'm just wondering a bit that user @carloscadux reported that the MSI package is now working properly too but I haven't done anything there yet, can someone check the MSI package quickly before I copy the dlls there too?

Actually, just tested build 1-8c5c3ae. Because of the dll issue it is not working in a clean install of Windows 10.
When I first tested and reported this issue, it was in a clean install too.
However, I had installed many applications after that, and the missing dlls may have been registered by Windows from other applications, and mistakenly I informed ksnip seemed to work.

@DamirPorobic
Copy link
Member

No worries, all good. I'll add the dlls then it should be working. Just need to find few spare minutes to do the change.

@DamirPorobic
Copy link
Member

Ok, it's now in the ZIP and MSI package, I think it should work everywhere now.

@carloscadux
Copy link

ZIP and MSI package are working now on a clean installation of Windows 10.
Thanks for the fix 👍

@DamirPorobic
Copy link
Member

Finally, then I'm closing this issue and wrapping up 1.9.2 patch.

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

No branches or pull requests

5 participants