Domanda

I have a complex app which cannot be linked statically with the CRT, but on the other hand does not require admin privileges to be installed (since it isn't doing anything that requires it). The normal way for installing the CRT so it can be linked to dynamically is to install the MS distributable CRT, but it requires admin privileges.

I am contemplating simply placing the MSVCRT100 DLLs in the same directory as the executable in order to alleviate the problem, but I'm not sure whether this practice has any downsides since it's not condoned or condemned anywhere I seen. Is there any reason not to do it, other than following the usual practice of static linking vs. installing the distributables?

È stato utile?

Soluzione

The short answer is yes you can.

It's even one of the option descibe on microsoft website to deploy application http://msdn.microsoft.com/en-us/library/dd293565.aspx

Copy the appropriate MFC and C Run-Time (CRT) library files—for example, for an x86 platform and Unicode support, copy mfc100u.dll and msvcr100.dll from \Program Files\Microsoft Visual Studio 10.0\VC\redist\x86\—and then paste them in the \Release\ folder of your MFC project. For more information about other files that you might have to copy, see Determining Which DLLs to Redistribute.


The downside is that the redistributable package is updated by microsoft security fixes. So if a security fix is deployed your application would not use it and may remains unsafe. I'm not a big fan, but it's the idea of the winsxs directory, and manifest since visual 7.0 which 'helps' your application to always use the best version.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top