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

VCRUNTIME140.dll #962

Closed
landloafer opened this issue Jun 1, 2021 · 26 comments
Closed

VCRUNTIME140.dll #962

landloafer opened this issue Jun 1, 2021 · 26 comments
Milestone

Comments

@landloafer
Copy link

Hi,
What is the use of VCRUNTIME140.dll? AppleWin runs fine just OK this dialogue window.

VCR

@landloafer
Copy link
Author

AppleWin is not "NOT RESPONDING".

@sicklittlemonkey
Copy link
Contributor

sicklittlemonkey commented Jun 1, 2021 via email

@sicklittlemonkey
Copy link
Contributor

Also, what version of Windows?

@landloafer
Copy link
Author

It is v1.30.2.0 and the Windows is 7.

@landloafer
Copy link
Author

I can put that 140.dll in the AppleWin folder. Expect with/without that dialogue, what else difference?

@sicklittlemonkey
Copy link
Contributor

Installing the following Microsoft VC runtime package should fix the problem:
https://aka.ms/vs/16/release/vc_redist.x86.exe

@tomcw
Copy link
Contributor

tomcw commented Jun 1, 2021

As of AppleWin 1.30.0.0, I'm now building AppleWin with VS2019 using v141_xp platform toolset.
So I guess this has added a runtime dependency for VCRUNTIME140.dll.

At this stage, I wouldn't want to include this 13MB vc_redist.x86.exe with AppleWin (and it would mean switching to a proper installer, not a zip).

I don't know if we are legally permitted to include VCRUNTIME140.dll within the AppleWin.zip - if we could then this would nicely solve this issue... unless this dll has further dependencies on additional dll's.

NB, it is available for download here: https://www.dll-files.com/vcruntime140.dll.html
But their disclaimer doesn't shed any light on the legality (and says to virus scan it before using it).

@landloafer
Copy link
Author

It works fine that way. Thanks.

@sicklittlemonkey
Copy link
Contributor

sicklittlemonkey commented Jun 2, 2021 via email

@landloafer
Copy link
Author

I put the 140.dll in the AppleWin folder.

@sicklittlemonkey
Copy link
Contributor

Tom, all AppleWin projects are set to statically link the runtime ... except for the HookFilter.

And actually, I think this filter can be in the application rather than in a DLL.
https://stackoverflow.com/questions/22975916/global-keyboard-hook-with-wh-keyboard-ll-and-keybd-event-windows

@audetto
Copy link
Contributor

audetto commented Jun 2, 2021

It is indeed the Filter

These 3 symbols are used

__std_type_info_destroy_list
_except_handler4_common
memset

@sicklittlemonkey
Copy link
Contributor

sicklittlemonkey commented Jun 3, 2021

Tom noticed that Willi reported the same problem as above here:
https://groups.google.com/g/comp.emulators.apple2/c/iPWOe1lMgtM/m/KQQm8KiEBwAJ

Willi also had a further problem:
The message is "...entry point ucrtbase.terminate could not be located in the dynamic link library api-ms-win..."

@audetto
Copy link
Contributor

audetto commented Jun 3, 2021

Up to version 1.29 AppleWin (i.e. HookFilter) required MSVCR90.DLL,

now it needs

VCRUNTIME14.DLL and API-MS-WIN-CRT-RUNTIME-L1.1.0.DLL (common to VS 2015+)

The only difference is that the old runtime was probably installed everywhere by now, while 14 is still new (2015+) and people need to install it explicitly.

https://support.microsoft.com/en-us/topic/the-latest-supported-visual-c-downloads-2647da03-1eea-4433-9aff-95f26a218cc0

Or, there is an option to copy the runtime to the outdir in VS

Configuration Properties -> Advanced -> Copy Cpp Runtime to OutDir

but I doubt you are meant to distribute it like this.

@tomcw
Copy link
Contributor

tomcw commented Jun 7, 2021

And actually, I think this filter can be in the application rather than in a DLL.

I created a new branch to try this: https://github.com/AppleWin/AppleWin/tree/GH962-HookFilter

And so far so good: I can link statically, and the Hook Filter still works.
Next, I'll try it on a machine without the VCRUNTIME140.dll and see how that behaves.

@sicklittlemonkey
Copy link
Contributor

sicklittlemonkey commented Jun 7, 2021 via email

@tomcw
Copy link
Contributor

tomcw commented Jun 8, 2021

I tried both the AppleWin.exe(1.30.2.0)+HookFilter.dll and the statically linked AppleWin.exe on Windows 10 version 20H2, and both worked fine without any message about VCRUNTIME140.dll.

NB. On this Win10 machine, it has never had Visual Studio installed.

So perhaps Win10 (20H2) comes with this VCRUNTIME140.dll... which makes it difficult to test whether the statically linked AppleWin.exe solves this issue.

@tomcw
Copy link
Contributor

tomcw commented Jun 8, 2021

Using dumppe.exe, I can see that HookFilter.dll (AppleWin 1.30.2.0) has these dependencies:

  • USER32.dll
  • VCRUNTIME140.dll
  • api-ms-win-crt-runtime-l1-1-0.dll
  • KERNEL32.dll

whereas HookFilter.dll (AppleWin 1.29.16.0) has these:

  • USER32.dll
  • MSVCR90.dll
  • KERNEL32.dll

(so same results as @audetto got above)

And AppleWin.exe (with statically linked HookFilter, built with platform toolset v141_xp ) has these:

  • COMCTL32.dll
  • WINMM.dll
  • DSOUND.dll
  • VERSION.dll
  • DINPUT8.dll
  • USER32.dll
  • GDI32.dll
  • ADVAPI32.dll
  • SHELL32.dll
  • COMDLG32.dll
  • ole32.dll
  • WSOCK32.dll
  • SHLWAPI.dll
  • KERNEL32.dll

So no VCRUNTIME140.dll in this new build!

@tomcw
Copy link
Contributor

tomcw commented Jun 8, 2021

OK, PR created in #964.
Take a look, otherwise I plan to merge it in tomorrow.

@sicklittlemonkey
Copy link
Contributor

sicklittlemonkey commented Jun 8, 2021 via email

tomcw added a commit that referenced this issue Jun 9, 2021
Remove the HookFilter.dll which had a dependency on VCRUNTIME140.dll
@tomcw tomcw added this to the 1.30.3 milestone Jun 9, 2021
@ralph-irving
Copy link
Contributor

Attached is a patch to update the AppleWinExpress2008 project to use the static hook filter.

AppleWinExpress2008-HookFilter.patch.txt

@tomcw
Copy link
Contributor

tomcw commented Jun 12, 2021

@ralph-irving - thanks, I've applied this patch at 0e275f0.

btw, we will probably delete the VS2008 proj/sln at some point, so I'd recommend switching to VS2019.
Also for patches, it's better to raise a PR (pull request) then it's easier for me to merge it, and you also get properly credited - GH will list you as a contributor.

@ralph-irving
Copy link
Contributor

Thanks for merging the patch. I am using VS2017 elsewhere but the winxp build vm I use to maintain several other projects doesn't support https to github so I can only pull from the repo using the git protocol.

I was surprised that the VS2008 project was still available. No worries on removing it.

@tomcw
Copy link
Contributor

tomcw commented Jun 19, 2021

Hi @landloafer - there's a new build here which should remove this dependency on VCRUNTIME140.dll.

Please check it and let me know how you get on.

@landloafer
Copy link
Author

It works very well. I can confirm the dependency error on 140.dll is gone on my Win7. As a merit, the hookfilter error is gone too.

@tomcw
Copy link
Contributor

tomcw commented Jun 21, 2021

Great! Thanks for confirming. Let me close this.

@tomcw tomcw closed this as completed Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants