[wix-users] Creating a simple XML while installation.

Jon Earle earlej at hotmail.com
Fri Sep 9 09:28:55 PDT 2016


Not quite what you are asking, but may shed some light.

We distribute a small XML file and need to modify it at install time.  The following code does that for us:

                <Component Id="agent_settings" Guid="GUID" SharedDllRefCount="yes" Win64="$(var.Win64)">
                    <File Id="service.xml" Name="service.xml" Vital="no" DiskId="1" Source="\path\to\service.xml" />

                    <util:XmlFile Id='SNMPXMLSettings1' File='[SNMP]service.xml'  Sequence='1'
                        Action='setValue' ElementPath='//service/executable' Value='[SNMP]snmp.exe' />
                    <util:XmlFile Id='SNMPXMLSettings2' File='[SNMP]service.xml'  Sequence='2'
                        Action='setValue' ElementPath='//service/logpath' Value='[SNMPLOGS]' />
                    <util:XmlFile Id='SNMPXMLSettings3' File='[SNMP]service.xml'  Sequence='3'
                        Action='setValue' ElementPath='//service/env[\[]@name="ConfigurationPath"[\]]' Name='value' Value='[INSTALLDIR]' />
                </Component>

Specifies the xml file component and some actions to take when it is included in a feature. The intellisense help for the Action attribute also includes 'createValue', so you could use a bunch of <util:XmlFile Action='createValue' ... >, with the correct xpath values, to create your xml file (we do something similar for a couple of INI files).

Cheers!
Jon

> From: kaveeshd at googlemail.com
> Date: Fri, 9 Sep 2016 20:33:59 +0530
> To: wix-users at lists.wixtoolset.org
> Subject: [wix-users] Creating a simple XML while installation.
> 
> Hi Guys,
> 
> I'm trying out to create a simple xml which has the following structure
> while the installation. This xml should automatically be deleted when the
> user uninstalls the product. The xml will get created at the appdata
> location.
> 
> <?xml version="1.0" encoding="utf-8"?>
> <Options Version="1.0">
>   <ToolInstallationOptionSelected Value="Yes" />
> </Options>
> 
> I am unable to find a solution for this, has anyone any idea for this?
> 
> Regards,
> Kaveesh
> 
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
 		 	   		  


More information about the wix-users mailing list