We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

vpuri
Posts: 4
Joined: Thu Apr 05, 2018 12:15 pm

Don't overwrite existing config file

Hello,

We are using Advanced Installer to create MSI packages that upgrade our software from an older version to a newer version. The application package includes a text configuration file (for example config.ini) that a user can edit after the package is installed. We would like to preserve this file instead of removing it when a software upgrade (a new version of the package) is performed on the same target. For example, we would like to copy an existing config.ini to copy-config.ini before the config.ini in the new package is installed.

Is the above action supported? If so, how would I do this using Advanced Installer?

Thank you for your help.
vpuri
Posts: 4
Joined: Thu Apr 05, 2018 12:15 pm

Re: Don't overwrite existing config file

Forgot to mention that we are using Advanced Installer for Java v14.7. Thank you again for any help.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Don't overwrite existing config file

Hello,

During an upgrade, to simply preserve the old installed file (and do not install the new version of the file) you can proceed like this:
1. go to "Files and Folders" page and right click on the config file; choose "Properties"
2. go to "Operations" tab and select the "Do not overwrite existing file" option and use the following condition:

Code: Select all

OLDPRODUCTS
If your config file is imported into your project as a Windows Installer file, not as a regular file, then you can proceed like this:
1. go to "Files and Folders" page and right click on the config file; choose "Go To Component"
2. check the "Permanent" and "Never Overwrite" attributes

Otherwise, if you want to create a backup of the old config file before being updated with the new version, then you can create your own custom action which will create a backup copy of your config file before the old product version is uninstalled during the upgrade process. The custom action should be scheduled before the "Install Execution Stage -> Preparing" action group.

Let us know if you have any further questions.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”