Merge old version config file with new version of MSI - Advanced Installer Community
vikasb
Posts: 9
Joined: Thu May 28, 2020 11:20 am

Merge old version config file with new version of MSI

Hi,
I have a MSI for windows service with version 1.0.1
In the config file of this MSI, some of the config attributes are taken during installation, and remaining attributes will be set by user.

Now when I try to install Same MSI with version 1.0.2, it is replacing the old config file with new one.
I want to keep old config file as it is, and MSI should replace those attribute values which are taken during installation process from dialogs.
Other attributes which user must edit manually, these attribute values should not be modified when installed (new) 1.0.2 MSI.

I would also like to know if there is a way that when we are upgrading MSI then, read some attributes values from already present config file and show it on installation dialogs. So that if user wants to change these else he will keep these values as it is and continue for upgrade.
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Merge old version config file with new version of MSI

Hello,

As you may already know, the upgrade process (e.g. from 1.0.1 to 1.0.2) consists of two steps:

- the removal of the older version

- the installation of the newer version

Basically, during an upgrade, the config file is removed entirely during the uninstall process of the older version. What we want to do here is to preserve the file.

I am assuming here that your configuration file is an .INI file. In order to preserve it (it isn't removed during an upgrade), please proceed as it follows:

- go to "Custom Actions" page

- under "Install Execution Stage", right click on "Remove Resources" --> "Show Standard Action" --> "Remove Resources" --> click on "RemoveIniValues"

- now select it from the custom actions list and condition it as it follows:
NOT UPGRADINGPRODUCTCODE
This way, the file will no longer be removed during the uninstall process of the older version.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”