Log in

View Full Version : VS2015 and WinXP?


LoRd_MuldeR
26th July 2015, 20:33
Today I made some first tests with VS2015. Apparently, there still is a special "platform toolset" to target WindowsXP, called v140_xp now.

Okay, the resulting executable file depends on a new DLL, called VCRUNTIME140.DLL. Apparently, this new DLL is the replacement for what was called MSVCRTxxx.DLL in all the previous Visual Studio versions.

But when I try to run the executable on my WindowsXP VM, with VCRUNTIME140.DLL in place, it won't start - because of a missing reference to API-MS-WIN-CRT-RUNTIME-L1-1-0.DLL :confused:

API-MS-WIN-CRT-RUNTIME-L1-1-0.DLL exists on my Windows 7 machine, in "C:\Windows\System32", but it seems that Windows XP (with SP-3 installed) didn't have it. So is WindowsXP still supported or not?

(And please don't tell me that WindowsXP is hopelessly outdated and not worth worrying about anymore. I'm well aware of this. I just want to clarify whether VS2015 is able to target WindowsXP or not)

filler56789
27th July 2015, 05:56
Looks like XP requires yet another (unimaginatively-named) vc_redist*.exe:

http://www.microsoft.com/en-us/download/details.aspx?id=46881

burfadel
27th July 2015, 07:42
Looks like XP requires yet another (unimaginatively-named) vc_redist*.exe:

http://www.microsoft.com/en-us/download/details.aspx?id=46881

Even Windows 10 requires that for normal applications (Windows Apps have their own version of VS 2015 runtimes). The link above however is for an old version of the runtimes, you should really use the newest.

The following will be useful for you:
Visual C++ Redist Installer V37 - https://db.tt/dV019W7e

It includes the latest runtimes, both x86 and x64 (both minimum and additional for the later runtimes) of 2005, 2008, 2010, 2012, and 2015, as well as the latest Fsharp runtime and core pre-2005 runtimes. It uninstalls existing runtimes and installs the new runtimes.

jpsdr
27th July 2015, 08:37
The up to date link is probably this (http://www.microsoft.com/en-US/download/details.aspx?id=48145).

LoRd_MuldeR
27th July 2015, 18:39
Oh dear! Are you telling me that, with Visual Studio 2015, we are again required to actually install the Redistributable package - instead of just putting the required Runtime DLL's in place :confused:

And I though Microsoft had learned their lesson, when they removed this nasty requirement with Visual Studio 2010. Sigh :(

jpsdr
27th July 2015, 18:57
So, the true question now is, if you install the redistribuable 2015 under Windows XP, does it work now ?

LoRd_MuldeR
27th July 2015, 19:09
So, the true question now is, if you install the redistribuable 2015 under Windows XP, does it work now ?

Yup:

http://i.imgur.com/SvdWyqc.png


Interestingly, a "fresh" Windows 10 without the VS2015 Redist installed, is lacking the VCRUNTIME140.DLL. But, as soon as VCRUNTIME140.DLL is in place (VS2015 Redist still not installed) the application will work fine.

So, despite the executable depends on all the API-MS-WIN-CRT-*.DLL files, those apparently are not actually required on Windows 10. And no, they do not ship with Windows 10. At least the Dependency Walker is unable to locate them :confused:

burfadel
28th July 2015, 00:34
No they aren't included. Ideally all the C++ runtimes would be updated through Windowsupdate to the latest versions always, however I believe for legal reasons they can't do that (anti-competitive). Only critital security updates for existing runtime installs are done through Windowsupdate.

There is a massive negative against having the runtime in the program folder. If there is a runtime update, the program will still use the old runtime in the folder. This runtime could be a security issue, or be prone to crashes etc. even if you update the C++ runtime install. You can in 99.99 percent of the cases safely remove the runtime files from the program folder and force to use the one in the system folder, which ideally would be the latest. The only times that can't be done is if the program directly calls for the runtime in the program folder, which is bad programming and it shouldn't. As long as the runtime is of the same series (2012 etc), then they are backwards compatible.

So, although having the runtime in the folder is convenient, it really isn't the ideal situation.

nevcairiel
28th July 2015, 09:58
No they aren't included. Ideally all the C++ runtimes would be updated through Windowsupdate to the latest versions always, however I believe for legal reasons they can't do that (anti-competitive). Only critital security updates for existing runtime installs are done through Windowsupdate.

They did change the C/C++ runtime strategy with VS2015 though, so that may change in the future, and it may update transparently.

In short, the runtime is now split in two parts, the small VCRuntime (ie. vcruntime140.dll), and the Universal CRT. The second part is a OS component, ships with Windows 10 and be distributed via WU on previous version of Windows, and of course updated through WU.

It was explained here:
http://blogs.msdn.com/b/vcblog/archive/2015/03/03/introducing-the-universal-crt.aspx

PS:
Note that app-local deployment is not supported anymore (ie. having the runtime dll in the folder of your app), either use static-linking or bundle VCRedist to install it.

burfadel
28th July 2015, 11:47
The universal CRT is used by apps (Modern/Metro), the small VCruntime is used by normal applications (consisting of both minimum and additional components).

LoRd_MuldeR
28th July 2015, 19:03
The universal CRT is used by apps (Modern/Metro), the small VCruntime is used by normal applications (consisting of both minimum and additional components).

Well, you can easily verify that executables compiled with VS2015 and linked against "DLL" Runtime will now depend on vcruntime140.dll and at the same time on bunch of non-standard system DLL's in the from of API-MS-WIN-CRT-*.DLL.

The former seems to be the replacement for the old MSVCRTxxx.DLL and you can still put it directly into the application directory. It's even contained in the Visual Studio 2015 "VC\redist\x86\Microsoft.VC140.CRT" folder.

But that doesn't help much, if you also need all those new system DLL's that simply didn't exist in older Windows versions. And since those seem to be an "addon" OS component, you don't want to (can't) deploy them into the app directory...

burfadel
28th July 2015, 20:13
The runtimes in the Windowsapps folder are actually not the latest version number wise, surprisingly. However, they also get an _app suffix. The file sizes are a little different too. Of course, you would expect this with different builds, but there are a couple of files that are a little more different than you would normally expect. I believe the app runtimes are therefore slightly different.

Windows APP 2013 CRT (12.0.21005.1):
Directory of C:\Program Files\WindowsApps\Microsoft.VCLibs.120.00_12.0.21005.1_x64__8wekyb3d8bbwe

25/07/2015 23:52 <DIR> .
25/07/2015 23:52 <DIR> ..
11/07/2015 02:01 3,636 AppxBlockMap(10349).xml
11/07/2015 02:01 3,636 AppxBlockMap.xml
11/07/2015 02:01 843 AppxManifest(10350).xml
11/07/2015 02:01 843 AppxManifest.xml
25/07/2015 23:52 <DIR> AppxMetadata
11/07/2015 02:01 10,398 AppxSignature(10352).p7x
11/07/2015 02:01 10,398 AppxSignature.p7x
11/07/2015 02:01 515 logo(10353).png
11/07/2015 02:01 515 logo.png
11/07/2015 02:01 669,416 msvcp120_app(10354).dll
11/07/2015 02:01 669,416 msvcp120_app.dll
11/07/2015 02:01 827,856 msvcr120_app(10355).dll
11/07/2015 02:01 827,856 msvcr120_app.dll
11/07/2015 02:01 481,944 vcamp120_app(10356).dll
11/07/2015 02:01 481,944 vcamp120_app.dll
11/07/2015 02:01 356,768 vccorlib120_app(10357).dll
11/07/2015 02:01 356,768 vccorlib120_app.dll
11/07/2015 02:01 59,568 vcomp120_app(10358).dll
11/07/2015 02:01 59,568 vcomp120_app.dll

C++ complete runtime for 2015 x64 (12.0.21005.1):
Directory of H:\Stuff\Sharing Stuff\Miscellaneous\Visual C++ Redist Installer V37\vcredist_x64_2013\System64

05/08/2014 08:11 <DIR> .
05/08/2014 08:11 <DIR> ..
04/10/2013 23:58 5,608,088 mfc120.dll
04/10/2013 23:58 46,248 mfc120chs.dll
04/10/2013 23:58 46,248 mfc120cht.dll
04/10/2013 23:58 74,920 mfc120deu.dll
04/10/2013 23:58 65,192 mfc120enu.dll
04/10/2013 23:58 73,896 mfc120esn.dll
04/10/2013 23:58 74,920 mfc120fra.dll
04/10/2013 23:58 72,872 mfc120ita.dll
04/10/2013 23:58 53,928 mfc120jpn.dll
04/10/2013 23:58 53,416 mfc120kor.dll
04/10/2013 23:58 70,824 mfc120rus.dll
04/10/2013 23:58 5,634,720 mfc120u.dll
04/10/2013 23:58 91,808 mfcm120.dll
04/10/2013 23:58 91,808 mfcm120u.dll
04/10/2013 23:58 660,128 msvcp120.dll
04/10/2013 23:58 963,232 msvcr120.dll
04/10/2013 23:58 481,952 vcamp120.dll
04/10/2013 23:58 356,528 vccorlib120.dll
04/10/2013 23:58 137,376 vcomp120.dll

The second listing above includes the additional runtime files, hence the mfc files. However, even for the standard files there is a big difference despite being 'the same' version. Presumably if the files were the same, the 2012, 2013, and 2015 runtimes in the app folder would be the same as the standard runtimes? Even if they were updated, why isn't the latest 2015 runtime installed in the app folder?

More importantly, why the _app extension, when programs supposedly using these, if they were for normal applications, would be looking for the files without that suffix?

nevcairiel
30th July 2015, 00:24
The universal CRT is used by apps (Modern/Metro), the small VCruntime is used by normal applications (consisting of both minimum and additional components).

The VCRuntime uses the Universal CRT to provide the functionality, its just a frontend for it. Both "apps" and native applications use the Universal CRT, directly or indirectly.

burfadel
30th July 2015, 03:31
The VCRuntime uses the Universal CRT to provide the functionality, its just a frontend for it. Both "apps" and native applications use the Universal CRT, directly or indirectly.

Is that regardless of the version of CRT installed on the system?...

For programs that are dynamically linked to the Visual C++ runtime, and where there are no .dll's in the program folder (these override the C++ runtimes installed on the system, possible posing security or stability/performance issues), the program will not work.

If what you said is the case, then no program under Windows 10 requires any C++ runtimes whatsoever to be included, since the universal apps folder contains runtimes for 2012, 2013, and 2015. You might as well get to removing all instances of these from program features etc, if you believe that is the case! (keeping in mind that programs requiring these still may work if the dll's are in the program folder or somewhere else in the system path).

nevcairiel
30th July 2015, 09:26
If what you said is the case, then no program under Windows 10 requires any C++ runtimes whatsoever to be included, since the universal apps folder contains runtimes for 2012, 2013, and 2015. You might as well get to removing all instances of these from program features etc, if you believe that is the case! (keeping in mind that programs requiring these still may work if the dll's are in the program folder or somewhere else in the system path).

I haven't tested yet if Win10 includes runtimes for all relevant previous versions, but its possible.

The only point I wanted to make is that any VS2015 build binary will use the Universal CRT, be it directly or indirectly through VCRuntime. Which is what MS wants to transition to, a thin wrapper that belongs to the compiler (ie VCRuntime is versioned and comes with VS2015), and a Universal CRT that is a OS component (installed and managed through WU) and not tied to the compiler version.

burfadel
30th July 2015, 11:56
That may be the case and actually makes sense, but you would still need the runtimes installed for normal applications to work in that case especially if any of the additional runtime files are used. However, the runtimes would essentially be an extension of sorts to the universal CRT.

I notice that there is only x64 version of the universtal CRT for VS 2012 (Microsoft.VCLibs.110.00_11.0.51106.1_x64) installed in the windowsapps folder, at least for me... btw I did shorten the folder name in the bracket as the rest of the file name is consistent across all folders (__8wekyb3d8bbwe).

VS 2013 (Microsoft.VCLibs.120.00_12.0.21005.1) and 2015 (Microsoft.VCLibs.140.00_14.0.22929) both have x86 and x64 versions.

These may have been updated since then, but the Windows Store is completely stuffed for me (will not load), universal apps load though. The wsreset program doesn't work either, it says I need to reinstall it for it to work (the wsreset program that is). SFC and DISM (restorehealth) etc pass everything fine.