Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

How does replacing files on reboot work?


1 reply to this topic

catrill

catrill
  • Full Members
  • 16 posts

Posted 16 March 2004 - 18:09

In the InstallFiles action, MSI can proceed even if files that are in use need replacing, by ensuring they are replaced when the computer reboots, and informing the user that a reboot is needed at the end of installation. How does this work internally? We are trying to work out what caused a reboot to be requested, and unfortunately don't have any logs of the installation.



hteichert

hteichert
  • Members
  • 158 posts

Posted 17 March 2004 - 09:52

There are two different mechanisms to replace locked files, depending on the operating system:

1) Win 9x (95, 98, ME)
New versions of currently locked files are copied to the harddisc with a temporary name. Further on, an entry is written to the file "wininit.ini" in the windows-folder how this temporary file has to be renamed. The renaming is done by "wininit.exe" during the next reboot, which works line by line through the "wininit.ini" file. After this process, "wininit.ini" is renamed to "wininit.bak". There's a big problem with this file-replacement mechanism, because it only works with 8.3 filenames as the lfn support is still missing at the time wininit.exe is running. (Did you never wonder why still all important system files have 8.3 names?)

2) Win NT, 2000, XP, 2003
New versions of currently locked files are copied to the harddisc with a temporary name. Further on, an entry with the name "PendingFileRenameOperations" of type REG_MULTI_SZ is written to the registry at
\\HKLM\SYSTEM\CurrentControlSet\Control\SessionManager
describing the rename operation. There are always pairs of entries added to this reg-key, with the first one being the current (temporary) name, the second one being the name to be renamed to. The renaming operation is performed at next reboot.

A further description of the whole renaming mechanism can be found at
http://msdn.microsof.../movefileex.asp
h.teichert-ott