overwrite system dll's

Posted on 2001-07-10
Medium Priority
Last Modified: 2013-12-03
I'm installing a software and I need to update some dll's in the system folder.
some of these dll's are always locked by the system, and the installer (which is a tcl script) fails on the copy.

How do I do this, how to overwrite the dll's?
Question by:romanm

Accepted Solution

mxjijo earned 900 total points
ID: 6270409

There are 2 scenarios. I hope you can do Win32 stuff from TCL

1) You need to replace the DLL's in use.
2) You need to replace the System DLL's.

In the first case, use MoveFileEx() with MOVEFILE_DELAY_UNTIL_REBOOT flag. On reboot the system will replace the Old file with the new file.

The second case is a little more complicated. Windows protects all its system files with WFP (Windows File Protection) - Its sux!! When you try replace/modify any of these protected files, Windows will simply replace it with the Original installed copy from its cache. But, the good news is, there is an undocumented Reg entry that the experts found out, which can disable WFP. I forgot that regKey, You need to look up in the newsgroups for MoveFileEx()

LVL 20

Expert Comment

ID: 6270580
mxjijo is right. However, MoveFileEx with DelayUntilReboot works only in winNT. In win9x you have to edit the file "C:\Windows\WinInit.ini" to replace files that are in use during the next reboot. The WFP problem in winME remains the same...

Regards, Madshi.
LVL 86

Expert Comment

ID: 6271248
MS has two KB articles that describe this issue in detail:

http://support.microsoft.com/support/kb/articles/Q140/5/70.ASP ('HOWTO: Move Files That Are Currently in Use' - W2k/NT and Win9x)

An additional methid for Win9x is described in http://support.microsoft.com/support/kb/articles/Q172/4/56.ASP ('How to Automatically Replace Files In Use by Windows 95')

An additional method for W2k/NT can be found at http://support.microsoft.com/support/kb/articles/Q181/3/45.ASP ('How to Replace Files In Use at Windows NT Restart')

Expert Comment

ID: 6271794
Every dll/ttf/exe/vxd that is shipped with Windows 98SE/2000/ME/XP is protected with either SFP, SFC, or WFP.

Getting around SFP in Windows 98SE isn't too hard. Getting around WFP in Windows 2000 (with no service packs installed) isn't too hard either with a little dissassembly of core system files.  After SP1 is installed there really isn't any easy way to disable WFP. And Windows XP is looking darn near impossible to disable.

Unless you get a digital signature on your CAB file from Microsoft by testing it in their laboratories, you're going to have to disable the WFP.

Is this the type of system file you are talking about? Or are you referring to simply an in-use file?

*note: SFC=SystemFileChecker, WFP=WindowsFileProtection, SFP=SystemFileProtection

Author Comment

ID: 6276955
I've used the MoveFileEx solution.
I still prefer to do it using the registery but a deadline is a deadline.
tnx mxjijo

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question