Preserve Old Configuration Files During Upgrades in Advanced Installer
A continuous activity when it comes to any software application is providing security, improvements, and functional upgrades. But what happens if the end-user has made his personal application configurations and a new update arrives? How can we make sure these user preferences are preserved after an update installation?
Let’s take one real-life scenario from one of our customers:
“I have built different installers for products and plugins; all of them have many configurations, ports, URLs, domains, and special properties, and all have been saved in the configuration file. The idea now is, when doing updates/upgrades, to be able to use these old configuration files and to save the user from entering old settings.
Or, when doing an upgrade/update, if a user is using an old configuration (ports, databases, server), to have a smooth upgrade without needing the user to know anything about the configuration.”
Luckily, with its intuitive GUI and integrated functions, Advanced Installer offers an easy solution to preserve configuration files during software updates.
In this guide, we will walk you through the steps to ensure that user-specific settingsremain unchanged when deploying a new version of your software.
Why Preserve Configuration Files?
Imagine the end user installing the application for the first time. He opens the app, and he needs to configure a bunch of settings like connection servers, ports, and users, or he creates a complex workflow environment, redesigning the GUI of the app, as mentioned earlier by our customer. All these settings are saved automatically in a config file on the machine.
Overwriting these files during an upgrade means users must reconfigure everything, which can lead to a time-consuming and frustrating process.
To avoid this, Advanced Installer allows you to retain specific files during the installation/update process.
How to Preserve Configuration Files in Advanced Installer During an Upgrade
1. Launch Advanced Installer and open your existing .AIP project file. Add any new files for the updated version.
2. In the left panel, go to the Files and Folders page and find the configuration file that you want to preserve. Typically, these files are stored in AppData, ProgramData, or the application installation folder.

For example, if your configuration file is named `config.ini` and is located in `C:\Program Files\YourApp\config.ini`, navigate to this location in the Files and Folders section.
3. Modify the file properties by right-clicking on the configuration file (`config.ini`). Select Properties from the context menu, then go to the Operations tab. Enable the option Do not overwrite the existing file and set the condition to OLDPRODUCTS.

The OLDPRODUCTS condition ensures that, if a previous version of the software is detected, the existing configuration file will not be replaced with the new one from the installer.
4. Build and test the installer by installing the previous version of your software first, making modifications to the settings that are reflected in the configuration file, then run the new installer and check if the configuration file remains unchanged.
Other Factors to Note
- For extra security, you can create a Custom Action to back up configuration files before the upgrade and restore them afterward.
- In some cases, you may want to update the configuration file only if the new version is more recent. You can achieve this by using File Version Conditions within Advanced Installer.
- Instead of storing user settings in files, you can use Windows Registry to manage configurations. Advanced Installer allows you to configure registry settings to persist across updates.
If you’re new to Advanced Installer, explore this feature with its 30-day, fully featured free trial.
Conclusion
Ensuring that user settings remain intact during software upgrades is essential for a seamless user experience. By using Advanced Installer’s Do Not Overwrite feature and the `OLDPRODUCTS` condition, you can prevent configuration files from being replaced while still delivering software updates.
Let me know your thoughts or questions in the comments below.
FAQs
Why is it important to preserve configuration files?
Overwriting these files during an upgrade means users must reconfigure everything, eventually leading to a time-consuming and dissatisfaction process. To avoid this, Advanced Installer allows you to retain specific files during the installation/update process.