How to Overwrite System Files during Installation
Keywords: system files in use
Question:
I am writting a install script. I need to replace several system DLLs. When I try to copy down the updated files the script stops because it can not overwrite a file in use.Answer:
- Every install package I have yet seen does not try to copy over system files without a reboot.
After deciding to update the DLLs... most people do something like copy the files to the temp directory on the local drive, then create/update the wininit.ini file in the local windows directory, such that the system files are moved onto the system files (replacing them) AFTER bootup but BEFORE Win95 starts.
- Copy them down to the same directory but with different names. Maybe just a DLX extension (instead of DLL).
- To determine Windows NT platform, see WinMetrics(-4).
- Use IntControl 30 instead of FileCopy. Works especially well on NT machines.
- To reboot machine, See IntControl(67...).
- For Windows 95: Construct a WININIT.INI file in the Windows directory.
It should look like:
;------snip------ [rename] realname1=tempname1 realname2=tempname2 realname3=tempname3 ;-------snip-------Note both the old and new new names should be FULLY QUALIFIED SHORT filenames. (See FileNameShort)
- Then reboot. See IntControl(67 ...).
Article ID: W13404Filename: Overwriting In Use System Files during Install.txt