cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jananig
Level 2

XML files are not overwritten during upgrade

Hi,

I am facing issue where non-versioned xml files are not updated during upgrade and still remains as base installer file.
Similarly we have text file and other xml files in our package. All the files are non versioned files, I guess overwrite issue will be occurs with other files too.

How to rectify this problem? Also I want to know how versioning can be done for xml and text files.

Any suggestion please?
Labels (1)
0 Kudos
(2) Replies
Reureu
Level 10

There is no need to version an XML file when you install it.
It is by definition a resource file which is not meant to be versioned.
Nevertheless, there is a way to achieve that: You could pack such resources in a DLL, and give this DLL a version number. Consequently, you would no longer be able to apply XML file changes to it.

Now if you want the XML file to get overwritten whatever it contains, you can set the corresponding file to "Always Overwrite", which will artificially give it a very high version number (65535.0.0.0).

Finally, are you applying any XML file change to this file?

And what sort of upgrade are you trying to perform? What project type are you working on?
If you are trying to do a "minor upgrade" with a Basic or InstallScript MSI project, you should stop straight away and go for a "major upgrade" which will save you lots of troubles later.
0 Kudos
Christopher_Pai
Level 16

You need to understand that the way MSI treats non-versioned files is incompatible with XML files. The rules for evaluating the key files of components are:

Creation Date != Modification date == user data, no overwrite or uninstall
Src File has Version and Dst File Does Not == always overwrite

The problem is that XML files are not an atomic resource like a DLL, Help File or Registry key. They are a complex delta where you really need to preserve changes from the base and merge them back into the new base.

It takes a bit of design and plumbing to do this. A simple always overwrite is frequently not good enough.
0 Kudos