We have a product installer created with Wix, containing a program package (“V1“) and some configuration files. Now, we are going to make a major upgrade with a new product code, where the old version of the product is uninstalled and “V2” is installed. What we want is to save one of the configuration files from uninstalling, since it is needed for the V2, too. Unfortunately, we forgot to set the Permanent="yes" option when we delivered V1 (read this question for more information).
Here comes the question: is there an easy way of preventing the uninstall of the file anyhow? Of course, we could add a custom action to the script to backup the file before uninstallation, and another custom action to restore it afterwards, but IMHO that seems to be overkill for this task, and might interfere with other parts of the MSI registration process.
EDIT: And yes, the NeverOverwrite="yes" attribute is already set in V2, and the behaviour is as I described it.
I don’t think it will help to change something directly in the component parameters of V2. Perhaps there’s a chance to modify the registry somehow in a custom action before uninstalling V1 so the installer service thinks the configuration file in V1 was installed with Permanent="yes"?
Try the
NeverOverwriteattribute for the configuration fileEDIT
I have just tested this in a test setup. At first it didn’t work because I had scheduled the
RemoveExistingProductsaction beforeInstallInitializesequence. This removes the old product before the new product is installed so it can’t compare.However when I set it to after
InstallFinalizeit did work, it left the file there even though the original setup didn’t haveNeverOverwriteset. here are my two test examplesversion 1.0.0.0
version 1.0.1.0