Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 493
  • Last Modified:

overwrite system dll's

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?
1 Solution

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()

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.
MS has two KB articles that describe this issue in detail: ('HOWTO: Move Files That Are Currently in Use' - W2k/NT and Win9x)

An additional methid for Win9x is described in ('How to Automatically Replace Files In Use by Windows 95')

An additional method for W2k/NT can be found at ('How to Replace Files In Use at Windows NT Restart')
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
romanmAuthor Commented:
I've used the MoveFileEx solution.
I still prefer to do it using the registery but a deadline is a deadline.
tnx mxjijo
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now