How Files are Overwritten by Windows Installer Service

How Files are Overwritten by Windows Installer Service
PRASANNA KUMAR RAJA's picture

Understanding the rules Windows Installer uses to overwrite files can help minimize the time to troubleshoot installation problems. There are two distinct rules that the Windows Installer service uses when determine if a file should be overwritten: Versioned Files and Non-Versioned files.

Versioned File

  • If the file version on the target system is the same as that in the setup package, then the file will not be updated, irrespective of the date.
  • If the file version on the target system is older than that in the setup, then the file will be overwritten.
  • If the file version on the target system is newer than the file within the setup, then it will not be overwritten.

Non-Versioned File

  • If the file on the target system has a later modified date versus created date, then it will not be overwritten, as it is considered user data.
  • If the file on the target system has the same created and modified date, then it will overwrite the file.
  • If the created date is later than the modified date, then the file will be overwritten.
3.756095
Average: 3.8 (41 votes)

Also For unversioned

anuragyadav's picture

Also

For unversioned files

Windows Installer will compare the created time and the last modified time of the destination file. If the times are the same, Windows Installer will compare file hashes of the source and destination files. If the file hashes are different, Windows Installer will install the component (and all of the files in it, including the key path). If the file hashes are the same, Windows Installer will not install the component but instead only reference counts the component.

Anurag Y

mix of versioned and non-versioned file

Hi Prasanna,

May i know how will install treat the sitution if the target has an un-versioned/non-versioned file while the msi has a versioned file

secondly how will installer behave if the situation is the reverse.. ie., target has a versioned file and installer has an unversioned file

Thirdly of these following parameters please list then in the order or precedence..
1. file version
2. create date
3. modify date
4. any other factor involved