Archive: upgrading msvcrt.dll


upgrading msvcrt.dll
Hi guys,

To those that it may concern: Good work chaps!

My question: What is the definitive way of upgrading dlls such as msvcrt.dll and mfc42.dll? Don't the dlls need to be copied to the system directory on reboot, and then registered? The thread about CompareDLLVersions was useful but petered out at the end.

I would be very grateful to whoever gives me the answer!

Cheers,
James:p


To be perfectly honest, this is a bit of a pain regardless of what installer you use. There are all sorts of version conflicts and possible future scenarios that make replacing MSVCRT.DLL a very dangerous proposition.

I just link statically when I build. You would think that it defeats the purpose of having these libraries, but it doesn't increase EXE size very much unless you rely heavily on MFC.

That said, I think that Microsoft has a self-extracting redistributable binary somewhere. You can just include that whole self-extracting EXE in your NSIS project and ExecWait it. There is some command-line flag to make it quiet (ie, no message boxes)... try passing it /? and see what it says.


Hi!

I just found the solution for my DLL problemes (CompareDLLVersion topic).

Renaming the files will be done before runonce in the registery, so you should:

File DLLNAME.TMP
Rename /REBOOTOK DLLNAME.TMP DLLNAME.DLL

Add to runonce in the registry (see my topic): regsvr32.exe /s DLLNAME.DLL (/s makes it silent, without messagebox) :)

To check if the DLL on the system is older, see the GetLocalDLLVersion, GetDLLVersion info in my topic.


I think the best solution for DLL-Hell with system dlls (like mfc42.dll or msvcrt.dll) is to copy your versions of the dlls in your program directory. The programm directory is the first place the system searches for them.

~ Florian