Hello,

I am using Wix 2.0.5325.0

I have a app.config that I want to modify:

<configuration>
  <applicationSettings>
     <TestService.Properties.Settings>
        <setting name="Property" serializeAs="String">
          <value>Value</value>
        </setting>
        <setting name="MyProperty" serializeAs="String">
           <value>MyValue</value>
        </setting>
      </TestService.Properties.Settings>
  </applicationSettings>
</configuration>

I want to insert the blue lines.
Remark, there are already lines before with the same node names before the
inserted lines!

I tried the following code in WIX:
        <XmlConfig Id='TestService_Settings_MyProperty'
            Action='create' Name='setting'
            File='[_TestService]TestService.exe.config'

ElementPath='//configuration/applicationSettings/TestService.Properties.Settings'
            On="install"
            Node="element"
            Sequence="1"
            />
        <XmlConfig Id='TestService.Settings.MyProperty.Name'
            File='[_TestService]TestService.exe.config'
            Name='name'
            ElementPath='TestService_Settings_MyProperty'
            Value="MyProperty"
            Sequence="2"
            />
        <XmlConfig Id='TestService.Settings.MyProperty.SerializeAs'
            File='[_TestService]TestService.exe.config'
            Name='serializeAs'
            ElementPath='TestService_Settings_MyProperty'
            Value="String"
            Sequence="2"
            />
        <XmlConfig Id='TestService_Settings_MyProperty_Value'
            File='[_TestService]TestService.exe.config'

ElementPath='//configuration/applicationSettings/NewBridges.Properties.Settings/[EMAIL
 PROTECTED]"MyProperty"[\]]'
            Action="create"
            Name="value"
            On="install"
            Node="element"
            Sequence='3'/>
        <XmlConfig Id='TestService.Settings.MyProperty.Value.Text'
            File='[_TestService]TestService.exe.config'
            ElementPath='Id='TestService_Settings_MyProperty_Value'
            Value="MyValue"
            Sequence="4"
            />

Now it works as expected until the red lines.
I get the message
fError 25542. Failed to find node:
//configuration/applicationSettings/TestService.Properties.Settings/[EMAIL 
PROTECTED]"
MyProperty"] in XML file: C:\Program
Files\TestService\TestService.exe.config, system error: -2147020584
which is correct, while this node is not yet in the file.
However when I leave out the red lines, the node <settings name="MyProperty"
/> is created.

I also tried the lines below instead of the red lines:
        <XmlConfig Id='TestService.Settings.MyProperty.Value'
            File='[_TestService]TestService.exe.config'
            ElementPath='TestService_Settings_MyProperty'
            Value="<value>MyValue</value>"
            Sequence="2"
            />
and several other things, but I was not able to create a xml-element with
sub-elements in an existing XML file

Anyone suggestions?

Jaap
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to