There are potential issues with the general idea of saving and restoring. If the file has an MSI file hash then the file you copy back won't match the installed file, and that means a repair is likely to restore the one from the MSI file.
It might be useful to describe what problem you're trying to solve. People do this kind of thing to preserve settings and data files that were modified, but Windows Installer won't update data files that were modified after installation. If that's the case, an upgrade with RemoveExistingProducts towards the end won't change the file, and you don't need to deal with it. Phil Wilson -----Original Message----- From: Dirk Räder [mailto:d...@raeder.cc] Sent: Tuesday, November 01, 2011 12:01 AM To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] Keep file on Upgrade? Hi Michael, you could use two Custom Actions to do so - the first (scheduled before installation) copies the file, the second (after InstallFinalize) copies it back and deletes the temporary file. Or you could add use a separate component for that file and add an install condition to the component, something like "If Not Exists". If WiX / MSI don't provide the necessary statements, code a CA that tests the file and fills a MSI property. Then check for that property. As you should leave the file handling completely to MSI, I would prefer the second way. 2011/10/31 Michael Tissington <michael_tissing...@ciqual.com>: > I have a text file that has been modified in a folder under ProgramData. > When doing an upgrade I need to keep the file > > If the file exists I'd like to take a copy of it to a temp location, > Perform the upgrade and then copy the file back. > > > How can I do this? > > > ------------------------------------------------------------------------------ > Get your Android app more play: Bring it to the BlackBerry PlayBook > in minutes. BlackBerry App World™ now supports Android™ Apps > for the BlackBerry® PlayBook™. Discover just how easy and simple > it is! http://p.sf.net/sfu/android-dev2dev > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > ------------------------------------------------------------------------------ RSA® Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users *** Confidentiality Notice: This e-mail, including any associated or attached files, is intended solely for the individual or entity to which it is addressed. This e-mail is confidential and may well also be legally privileged. If you have received it in error, you are on notice of its status. Please notify the sender immediately by reply e-mail and then delete this message from your system. Please do not copy it or use it for any purposes, or disclose its contents to any other person. This email comes from a division of the Invensys Group, owned by Invensys plc, which is a company registered in England and Wales with its registered office at 3rd Floor, 40 Grosvenor Place, London, SW1X 7AW (Registered number 166023). For a list of European legal entities within the Invensys Group, please go to http://www.invensys.com/en/legal/default.aspx. You may contact Invensys plc on +44 (0)20 3155 1200 or e-mail recept...@invensys.com. This e-mail and any attachments thereto may be subject to the terms of any agreements between Invensys (and/or its subsidiaries and affiliates) and the recipient (and/or its subsidiaries and affiliates). ------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now! http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users