[wix-users] Help with reading XML file properties...

Lewis Henderson henderso at opentext.com
Wed Feb 22 13:14:53 PST 2017


Hi Everyone,

I've got an issue reading the contents of an XML configuration file.  For modification installs, I need to read a series of settings from the installed configuration file and assign them to me installer's properties, setting the new "defaults".  I can do this with the Xml_SelectNodeAttributeValue function of the msiext xmltools.dll as shown below, but it's rather cumbersome.  Does anyone have a better method?  Any help is appreciated.

                                                                Lewis Henderson
                                                                OpenText Corporation

      <Publish Dialog="MyDlg" Control="Next" Order="3" Property="XML_FILENAME"
         Value="[MYPATH]server.xml">1</Publish>
      <Publish Dialog="MyDlg" Control="Next" Order="4" Property="XML_XPATH"
        Value="//Server/Service[\[]@name='Catalina'[\]]/Connector[\[]@protocol='HTTP/1.1'[\]]">1</Publish>
      <Publish Dialog="MyDlg" Control="Next" Order="5" Property="XML_ATTRIBUTENAME"
        Value="port">1</Publish>
      <Publish Dialog="MyDlg" Control="Next" Order="6" Event="DoAction"
        Value="XmlGetAttrValue">1</Publish>
      <Publish Dialog="MyDlg" Control="Next" Order="7" Property="MY_PORT"
        Value="[XML_ATTRIBUTEVALUE]">1</Publish>

    <CustomAction Id="XmlGetAttrValue"   BinaryKey="xmltools" DllEntry="Xml_SelectNodeAttributeValue"
       Execute="immediate"    Return="check" />
    <Binary Id="xmltools" SourceFile="..\msiext\CustomActions\XmlTools.dll" />



More information about the wix-users mailing list