You need to figure out why the upgrade is removing that file because as I said before it's not inevitable.
1. You should add that config file to your new setup with the same component guid. If you haven't got it in the new install then clearly it will be removed because that file is no longer in the later version of the product. 2. Then, if RemoveExistingProducts is late in the upgrade AND the existing config file has been modified after it was installed by the older product as you said, then it will not be removed because of the file replacement rules. File replacement rules: http://msdn.microsoft.com/en-us/library/windows/desktop/aa370532(v=vs.85).as px People are always upgrading their products without uninstalling databases and other data files, and this is the way it's done. Modified files don't get overwritten (see 1) and RemoveExistingProducts at the end of the install (see 2) is the way to do that. Phil W -----Original Message----- From: Kai Peters [mailto:kpet...@otaksoft.com] Sent: Thursday, August 15, 2013 6:51 PM To: General discussion for Windows Installer XML toolset. Subject: [WiX-users] How to retain a config file after a Major Upgrade? Hi, As elaborated in an earlier post my problem is this: I have to deal with MSIs that are out in the wild (created with Wise); our next MSIs will be created with Wix since Wise doesn't exist anymore. These old MSIs have installed an inifile that needs to survive a major upgrade coming from the new Wix based MSI because it contains valuable information added by our clients. During the uninstall portion of the Major Upgrade this inifile unfortunately does get removed. We know there are easy ways to handle this going forward, but for now our first Wix "release" is in jeopardy unless we can overcome this obstacle. So how does one reliably retain a config file under the given circumstances? A number of people (well, 2 I have found) mentioned the use of the CopyFile element in order to 1) backup of config file to a safe location 2) perform the uninstall of the old MSI 3) restore of config file from safe location This would be an approach that appeals to my common sense - none of the articles/answers related to this do provide an answer as to how one could schedule the backup & restore operations. From my understanding, only actions can be scheduled and I could not find any mention on how to wrap CopFile elements in there.... I also found another piece of the puzzle which has a slim chance of working for me: According to http://blogs.msdn.com/b/astebner/archive/2008/10/19/9006538.aspx If my old MSI has been built like described above ("1. Place each .config file in its own component and mark the .config file as the key path of the component.") then I might be in luck assuming I build the new MSI as described under 2). Do I understand that correctly? I will test this when back at work on Monday. As always, thanks for all suggestions & your time, Kai Peters ---------------------------------------------------------------------------- -- Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users