Hello,

I'm using XmlConfig quite extensively and have run into a few cases where
using Node="value" is not allowing me to do what I want.  The default
behavior appears to be:

-If the attribute does not exist, create it with the specified value
-If the attribute does exist, overwrite it with the specified value

However, I would like the behavior to be:

-If the attribute does not exist, create it with the specified value
-If the attribute does exist, leave it alone

I have tried adapting VerifyPath to this case, but it appears to be ignored
unless Node="element".  I also considered using ElementId, but this means no
attribute work will be performed unless the element itself is written again.
 A workaround I have considered is writing an immediate CA to go read these
values from the XML files and assign their values to properties.  The
XmlConfig authoring would then reference the property instead of the value
directly.  A slight variation is to write an extension which dynamically
adds XmlConfig table records at runtime depending on the current contents of
the file.  My hope is that there is an easier way :)


Example:

Original
  <configuration>
    <foo overwriteme="default" leavemealone="default"
  </configuration>

User-modified
  <configuration>
    <foo overwriteme="changed" leavemealone="changed"
  </configuration>

Repaired
  <configuration>
    <foo overwriteme="default" leavemealone="changed"
  </configuration>

Thanks,
Chris
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to