Hi,
I am using the XMLConfig element in Wix 3.8 to add to an existing XML file.

The xml file looks like this before running setup:

SnippetCollection>
    <Language Lang="CSharp" Guid="{694DD9B6-B865-4C5B-AD85-86356E9C88DC}">
        <SnippetDir>
            <OnOff>On</OnOff>
            <Installed>true</Installed>
            <Locale>1033</Locale>
            <DirPath>%InstallRoot%\VC#\Snippets\%LCID%\Visual C#\</DirPath>
            <LocalizedName>Visual C#</LocalizedName>
        </SnippetDir>
    </Language>
</SnippetCollection>

I want to add the highlighted lines with my setup:

SnippetCollection>
    <Language Lang="CSharp" Guid="{694DD9B6-B865-4C5B-AD85-86356E9C88DC}">
        <SnippetDir>
            <OnOff>Off</OnOff>
<!-More stuff -->
        </SnippetDir>
        <SnippetDir>
            <OnOff>On</OnOff>
            <Installed>true</Installed>
            <Locale>1033</Locale>
            <DirPath>%InstallRoot%\VC#\Snippets\%LCID%\Visual C#\</DirPath>
            <LocalizedName>Visual C#</LocalizedName>
        </SnippetDir>
    </Language>
</SnippetCollection>

In Wix these are my lines of code:
      <util:XmlConfig On="install" Action="create" Id="CreateSnippetDir" 
Node="element" File="<Path to Xml>\snippetsindex.xml" 
ElementPath="//SnippetCollection//Language" Sequence="1001"
      xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"; 
Name="SnippetDir"  />
      <util:XmlConfig On="install" Action="create" Id="CreateOnOff" 
Node="element" File="<Path to Xml>\snippetsindex.xml\snippetsindex.xml" 
ElementPath="//SnippetCollection//Language/SnippetDir" Sequence="1002"
      xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"; Name="OnOff" 
Value="off" />

Executing this, the resulting xml looks like this. Please note how the OnOff 
element is added within the existing SnippetDir element, not inside the new 
SnippetDir element:

<SnippetCollection>
    <Language Lang="CSharp" Guid="{694DD9B6-B865-4C5B-AD85-86356E9C88DC}">
<SnippetDir>
            <OnOff>On</OnOff>
            <Installed>true</Installed>
            <Locale>1033</Locale>
            <DirPath>%InstallRoot%\VC#\Snippets\%LCID%\Visual C#\</DirPath>
            <LocalizedName>Visual C#</LocalizedName>
        <OnOff>on</OnOff></SnippetDir>

<SnippetDir/></Language>
</SnippetCollection>

Can you please help me understand how I can fix this?
Thanks
Uma-

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to