1. So any idea why the code sample does not modify the xml file in the
correct sequence? I'm using build 4805. Do I need to do something like
reference the file by ID or something to ensure the dependency? I've tried
using what would be ProgramEXECONFIG in the sample below and that doesn't
seem to help.

2. I'll try to make something more specific and see if I can get it to go.


Thanks,
Peter

-----Original Message-----
From: Rob Mensching [mailto:rob.mensch...@microsoft.com] 
Sent: Thursday, January 15, 2009 2:38 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] XmlConfig questions

1.  The default sequencing of XmlConfig should modify the file after it is
installed.

2.  If you make your XmlConfig/@VerifyPath to reach deeper then it will not
configure things that already exist.  That should get you what you want.
I've done some pretty complex XML manipulations with very specific
VerifyPaths.

-----Original Message-----
From: Peter Oehlert [mailto:poehl...@securityinnovation.com] 
Sent: Thursday, January 15, 2009 12:57
To: 'General discussion for Windows Installer XML toolset.'
Subject: [WiX-users] XmlConfig questions

At a high level I have 2 questions:
1. How do you get XmlConfig to run *after* the config file is installed?
2. To change an existing element without a unique id, do I have to delete it
and recreate it?

So, I'm dealing with an XML config file that should look like this:
<configuration>
        <OnlineStorage>
                <Servers>
                        <clear/>
                        <add url="http://localhost/debug"; username=""
password=""/>
                </Servers>
        </OnlineStorage>
</configuration>


1. I put my XmlConfig entries as children to the Component element that also
has the File element of the configuration file itself. When looking at the
install log, the custom action SchedXmlConfig happens before the files are
copied. Of course, I need to have the xml file put into place before I can
configure it.

My wix file looks something like this:
<Component Id="ProgramEXECONFIG" Guid="*">
        <File Id="ProgramEXECONFIG" Name="Program.exe.config" KeyPath="yes"
Source="$(var.SourceFolder)Program.exe.config" />
        <util:XmlConfig
                Id="XmlConfigServersDelete"
                File="[INSTALLLOCATION]Program.exe.config"
                PreserveModifiedDate="yes"
                Action="delete"
                Node="element"
                ElementPath="//configuration/OnlineStorage"
                VerifyPath="Servers"
                Sequence="1"
                        />
        <util:XmlConfig
                Id="XmlConfigServersCreate"
                File="[INSTALLLOCATION]Program.exe.config"
                PreserveModifiedDate="yes"
                Action="create"
                Node="element"
                ElementPath="//configuration/OnlineStorage"
                Name="Servers"
                Sequence="2"
                        />
        <util:XmlConfig
                Id="XmlConfigClear"
                File="[INSTALLLOCATION]Program.exe.config"
                PreserveModifiedDate="yes"
                Action="create"
                Node="element"
                ElementPath="XmlConfigServersCreate"
                Name="clear"
                Sequence="3"
                        />
        <util:XmlConfig
                Id="XmlConfigAdd"
                File="[INSTALLLOCATION]Program.exe.config"
                PreserveModifiedDate="yes"
                Action="create"
                Node="element"
                ElementPath="XmlConfigServersCreate"
                Name="add"
                Sequence="4"
                />
        <util:XmlConfig
                Id="XmlConfigAddUrl"
                File="[INSTALLLOCATION]Program.exe.config"
                PreserveModifiedDate="yes"
                ElementPath="XmlConfigAdd"
                Name="url"
                Value="[WEBSERVICEURL]"
                Sequence="5"
                        />
        <util:XmlConfig
                Id="XmlConfigAddUserName"
                File="[INSTALLLOCATION]Program.exe.config"
                PreserveModifiedDate="yes"
                ElementPath="XmlConfigAdd"
                Name="username"
                Sequence="6"
                        />
        <util:XmlConfig
                Id="XmlConfigAddPassword"
                File="[INSTALLLOCATION]Program.exe.config"
                PreserveModifiedDate="yes"
                ElementPath="XmlConfigAdd"
                Name="password"
                Sequence="7"
                        />
</Component>

2. My second question is do I really need those 7 XmlConfig operations? All
I want to do is change the attribute url.

The thing is the config file that gets packaged up is already complete but
has a debug value specified. I want the installer to set the value the user
specifies on install. However, the <add /> element doesn't have an ID so how
can I reference it so I just change that one attribute
(//configuration/OnlineStorage/Servers/a...@url]).


Any help would be much appreciated, sorry for the long code samples but I
wanted to be complete.

--Peter


----------------------------------------------------------------------------
--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


----------------------------------------------------------------------------
--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to