Hello and welcome to our forums,
Determining whether to install a file is a complex process. At the highest level, this determination depends on whether the component to which a file belongs is marked for installation. Once determined that a file should be copied, the process is complicated if another file with the same name exists in the target folder. In such situations, making the determination requires a set of rules involving the following properties:
The installer only uses these rules when trying to install a file to a location that already contains a file with the same name. In this case, the Windows Installer uses the rules described in the
File Versioning Rules
article, all other things being equal, to determine whether to install.
If your files do not have a version, then the installer will compare the Modified and Create date of your files.
Nonversioned Files are User Data—If the Modified date is later than the Create date for the file on the computer, do not install the file because user customizations would be deleted. If the Modified and Create dates are the same, install the file. If the Create date is later than the Modified date, the file is considered unmodified, install the file.
Windows Installer’s versioning rules are global and hardcoded.
I've tested the following file scenarios:
1. Created: 2025-10-01 14:42:52
Modified: 2025-10-01 14:53:07
Here, Modified > Created → Windows Installer interprets this as user-modified (user data).
Nonversioned Files are User Data - If the Modified date is later than the Create date for the file on the computer, do not install the file because user customizations would be deleted.
2. Created: 2025-10-01 14:42:41
Modified: 2025-10-01 14:42:50
Here, Modified ≈ Created (difference of seconds only) → Windows Installer interprets this as an unmodified file (original installer file).
In this case, the file is overwritten.
and the file in Package A has a newer date (created date is the same as the modified date). Package B overwrites the file.
If I understand correctly, the file on the disk that is being overwritten has the same Created and Modified date? In this case, the expected behavior is to overwrite the file according to the file versioning rules:
If the Modified and Create dates are the same, install the file.
Let me know if you have any questions.
Best regards,
Liviu