y.langer
Posts: 2
Joined: Fri Apr 24, 2026 8:12 am

Issue with file overwrite behavior during installation and repair

Hello everyone,

I am facing an issue with the configuration of my installer in Advanced Installer and hope someone can help me.
For a single file in my installation, I need specific behavior.
The file is located in a separate folder. This folder contains only this single file.

Desired Installer Behavior:
  • Installation: If the file does not exist, it should be installed to the system.
  • Installation: If the file already exists, it should not be overwritten.
  • Repair: If the file exists, it should be overwritten.

Current Configuration:

The file has the following properties:
  • Do not overwrite existing files
  • Condition:

    Code: Select all

    AI_INSTALL_MODE <> "Repair"
The folder containing the file has the following properties:
  • Do not overwrite existing files
  • Condition:

    Code: Select all

    AI_INSTALL_MODE <> "Repair"
The component containing the file has only the attribute:
  • Permanent

Problem:
Despite this configuration, the file is overwritten during a version update, even though this should not happen. My goal is to ensure that the file is only overwritten during a repair.

Questions:
  • Is my current configuration correct to achieve the desired behavior?
  • Are there additional settings or conditions I need to adjust to ensure the file is only overwritten during a repair?

Thank you in advance for your support!
Liviu
Posts: 1382
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Issue with file overwrite behavior during installation and repair

Hello and welcome to our forums,

Please note that only the missing files are re-installed during a repair operation. The other files are not overwritten.

However, in order to force the re-installation of some files, you can proceed as explained in the thread below:

Registry entrys in Maintenance mode
Despite this configuration, the file is overwritten during a version update, even though this should not happen. My goal is to ensure that the file is only overwritten during a repair.
Regarding this, please send us your .AIP project files (first version, second version) and the mentioned file by e-mail at support at advancedinstaller dot com.

Let me know if you have other questions.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
y.langer
Posts: 2
Joined: Fri Apr 24, 2026 8:12 am

Re: Issue with file overwrite behavior during installation and repair

Thank you for your reply.

I tested the solution mentioned in the link on a simple project. Everything worked fine.

Then I tried the solution on my real project, but it didn't work.

The file that should exhibit this special behaviour is a database. My program runs as a service and the database is the file that is used most frequently by my program.
During the maintenance repair operation, the service is not stopped and the database cannot be replaced.

I tried adding custom actions to stop and restart the server during repair. But it did not work.

Could you give me some more advice on how to solve this new problem?
Liviu
Posts: 1382
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Issue with file overwrite behavior during installation and repair

Hello,

We've received your email.

We will reply to your email as soon as we have a conclusive answer.

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

Return to “Common Problems”