none
Installer fails to overwrite edited XML files RRS feed

  • Question

  • I am writing an application using Visual Studio 2008 Pro with .Net 2.0.  My application has an XML setup file serving as a config ini file.  The installer places the primary output (executable) and the content (XML file) in the Program Files folder.  With every new version of the software (e.g. changing 1.0.4 to 1.0.5), I change the Product Code and keep the Upgrade Code the same.

    I have the following properties set:
    InstallAllUsers    true
    DetectNewerInstalledVersion    true
    RemovePreviousVersion    true
    TargetPlatform    x86

    The problem is that if the XML file is edited from Program Files folder (after the software has been installed), the next version of the software will not overwrite the XML file.   Why won't the installer uninstall the old XML file (even if it has been edited) and install the new one?

    Thanks in advance.
    Tuesday, November 10, 2009 1:08 PM

Answers

  • (Really belongs in ClickOnce and Setup&Deployment Projects as in "Additional Common Forums" thread).

    The behavior of a VS 2008 setup is that it doesn't replace files that have been updated by the user (actually a Windows Installer update rule). If you had installed a database, then the customer made thousands of updates and then your upgrade destroyed all that your customers wouldn't be happy.

    So it appears that you really do want to get rid of whatever settings the customer (or was it your app?) has changed in there. There are a few choices:

    1) Have an upgrade update the Xml rather than expect it be replaced.

    2) Revert to the VS 2005 upgrade behavior of complete uninstall of the older version of the product and then installing the new one. (Post in the ClickOnce and Setup&Deployment Projects for how to do this).

    3) Install the file under another name and have a custom action remove the old one and replace it with the new one, renaming it.
    Phil Wilson
    • Marked as answer by arecibo82 Thursday, November 12, 2009 9:58 AM
    Tuesday, November 10, 2009 11:54 PM
  • Hello,

    Thanks Phil's suggestions, arecibo82, I believe you may follow Phi's suggestions to achieve the goal.

    In addition, as this forum is for the setup of .net framework, you may post your issue on the related language general forum or ClickOnce and Setup&Deployment Projects forum so you can get better and quicker response.

    Thank you for your understanding.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.
    Wednesday, November 11, 2009 8:36 AM
    Moderator

All replies

  • (Really belongs in ClickOnce and Setup&Deployment Projects as in "Additional Common Forums" thread).

    The behavior of a VS 2008 setup is that it doesn't replace files that have been updated by the user (actually a Windows Installer update rule). If you had installed a database, then the customer made thousands of updates and then your upgrade destroyed all that your customers wouldn't be happy.

    So it appears that you really do want to get rid of whatever settings the customer (or was it your app?) has changed in there. There are a few choices:

    1) Have an upgrade update the Xml rather than expect it be replaced.

    2) Revert to the VS 2005 upgrade behavior of complete uninstall of the older version of the product and then installing the new one. (Post in the ClickOnce and Setup&Deployment Projects for how to do this).

    3) Install the file under another name and have a custom action remove the old one and replace it with the new one, renaming it.
    Phil Wilson
    • Marked as answer by arecibo82 Thursday, November 12, 2009 9:58 AM
    Tuesday, November 10, 2009 11:54 PM
  • Hello,

    Thanks Phil's suggestions, arecibo82, I believe you may follow Phi's suggestions to achieve the goal.

    In addition, as this forum is for the setup of .net framework, you may post your issue on the related language general forum or ClickOnce and Setup&Deployment Projects forum so you can get better and quicker response.

    Thank you for your understanding.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.
    Wednesday, November 11, 2009 8:36 AM
    Moderator
  • Thanks Phil,

    I'll go for option 2 and use solutions described here:
    Non-versioned files won't update in msi install

    cheers
    Thursday, November 12, 2009 10:02 AM
  • raf

    Thanks so much for sharing.

    Saturday, January 22, 2011 10:57 AM