Here is the situation. I have a configuration file that on installation in 
release mode I use the XmlFile task to remove a section of the file. In debug I 
also use XmlFile to modify one of the elements in the file. Is what I am 
finding is that if I do a release installation followed by a debug installation 
the element that I am looking for is not found and the installation fails. If I 
look at the configuration file the section is missing. I was expecting the 
whole file to be copied to the installation folder (overwriting the release 
edited file) before I try the debug editing but apparently that is not 
happening. Is there some rule within WiX that it will not overwrite a file if 
it exists? If so can I override this behavior?

The applicable WiX code looks like:

      <Component Id="CMP_WpfAppConfig" Guid="*" Directory="WPFINSTALLDIR">
        <File Id="FILE_WpfAppConfig"
              Source="../WPFHost/app.Config"
              KeyPath="yes"/>
. . . . .
        <?if $(var.Configuration) = "Debug" ?>
        <util:XmlFile Id="WpfAppConfig14" File="[WPFINSTALLDIR]app.Config" 
Action="setValue" Name="initializeData" Value="f:\applog\app_tracelog.svclog" 
ElementPath="//configuration/system.diagnostics/sharedListeners/add[\[]@name=&quot;ServiceModelTraceListener&quot;[\]]"
 Sequence="14" />
        <?endif ?>
        <?if $(var.Configuration) = "Release" ?>
        <util:XmlConfig Id="WpfAppConfig15" Action="delete" 
ElementPath="//configuration" File="[WPFINSTALLDIR]app.Config" Node="element" 
On="install" Sequence="15" VerifyPath="system.diagnostics" />
        <util:XmlConfig Id="WpfAppConfig16" Action="delete" 
ElementPath="//configuration/system.serviceModel" 
File="[WPFINSTALLDIR]app.Config" Node="element" On="install" Sequence="16" 
VerifyPath="diagnostics" />
        <?endif ?>



Thank you.

Kevin Burton
Senior Software Engineer
BUYSEASONS
262-901-2000 Office
262-901-2312 Fax
kev...@buyseasons.com<mailto:kev...@buyseasons.com>

------------------------------------------------------------------------------
Forrester Wave Report - Recovery time is now measured in hours and minutes
not days. Key insights are discussed in the 2010 Forrester Wave Report as
part of an in-depth evaluation of disaster recovery service providers.
Forrester found the best-in-class provider in terms of services and vision.
Read this report now!  http://p.sf.net/sfu/ibm-webcastpromo
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to