Brent
Posts: 3
Joined: Mon Sep 29, 2025 1:28 am

Overwrite Files only if older not being honored

I have two packages that share a file that I install to a folder in ProgramData (the file shares the same guid in both packages). I am creating a new package (Package A) which has a newer version of the file (the file is not versioned in the original packages). When I upgrade from the old Package A to the New Package A, the old package A is uninstalled and the new one installed as you would expect.

However, even though Package B has the "Overwrite only if the existing file is older" option selected for this file, and the file in Package A has a newer date (created date is the same as the modified date). Package B overwrites the file.

I have tried versioning the file, changing the GUID, but the file always gets overwritten when installing Package B after the New Package A.

Is there any way to stop this or am I missing anything? I am using Advanced Installer 23.0.1
Liviu
Posts: 1325
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Overwrite Files only if older not being honored

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:

  • Version
  • Date
  • Language
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
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Brent
Posts: 3
Joined: Mon Sep 29, 2025 1:28 am

Re: Overwrite Files only if older not being honored

Thanks for the reply. I have read the file versioning rules, but it still doesn't really make sense to my situation. I'll see if I can explain it a little clearer.

Package A, installs the latest version of Application.jar. It has a created and modified date of September 26, 2025, 9.52.18 AM..
Package B installs an earlier version of Application.jar with a created and modified date of October 2, 2024, 9.20.00 AM.

The overwrite behavior in both packages is set to "Overwrite only if the existing file is older"

If I understand what you are saying correctly, because the file is not versioned it is considered a user data file, and because it hasn't been modified since being installed on the computer, it will always be overwritten despite the setting in the overwrite behavior options? So why is this even an option?

Based on this I tested a different scenario, and recompiled both packages, using the file version tab I selected "User Specified Version", 2.05 for Package B, and 2.06 for Package A.

After installing Package A, I checked the details of the file and there was no indication of it having a version number, additionally after installing Package B, it was still overwritten.

So my questions now are;

1) Is it only possible to set the version on specific file types?
2) If it is possible to set the version on any file type, how can you confirm the version of an installed? (The help states that versioning does not affect the internal version of a file, which I assume refers to the file "details" tab when checking properties of the file.
Liviu
Posts: 1325
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Overwrite Files only if older not being honored

Hello,

I tested this and was able to reproduce the issue occasionally, but not consistently.

Please give me some more time to further investigate this and maybe consult with our development team and I will come back as soon as I have more information.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Liviu
Posts: 1325
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Overwrite Files only if older not being honored

Hello,

It seems that this issue is no longer reproducible in our latest builds. I’ll send you a release candidate of version 23.2 via email so you can test it.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Brent
Posts: 3
Joined: Mon Sep 29, 2025 1:28 am

Re: Overwrite Files only if older not being honored

Liviu wrote: Tue Oct 07, 2025 8:05 am Hello,

It seems that this issue is no longer reproducible in our latest builds. I’ll send you a release candidate of version 23.2 via email so you can test it.

Best regards,
Liviu
Unfortunately, I am still seeing the same thing.
Liviu
Posts: 1325
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Overwrite Files only if older not being honored

Hello,

We need to continue this via email.

Please reply to the email I sent you. Also, send me the following resources:

1. the .AIP project files for Package A and Package B

2. the file mentioned that is overwritten - old and new version (Application.jar 2024 and 2025)

3. setup packages for Package A and Package B

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”