Thanks Pally,

I figured it out now...
I didn't know that there is a strict format on using XMLConfig
i.e i thought that by ommiting On='install' would still work. But that's 
not the case!

Just in case anyone is wondering here is how i made it work:

<util:XmlConfig Id='FileServerBasePath'
                        On='install'
                        Action='create'
                        Sequence='1'
                        File='[#file_id HERE]'
                        
ElementPath="//configuration/appSettings/add[...@key='FileServerBasePath'[\]]"
                        Node="value"
                        Name="value"
                        Value='TestModification'/>

This for example will:
-access the file with id: "file_id HERE"
-locate the element <add> under the element <appSettings> which has an 
attribute "key" and it's value is "FileServerBasePath"
-get that element's attribute called "value", and change the value of 
that to: "TestModification"

Before:
<?xml version="1.0"?>
<configuration>
    <appSettings>
            <add key="FileServerBasePath" value="BeforeValue"/>
    </appSettings>
</configuration>

After:
<?xml version="1.0"?>
<configuration>
    <appSettings>
            <add key="FileServerBasePath" value="TestModification"/>
    </appSettings>
</configuration>

Pally Sandher wrote:
> XMLConfig & XMLFile don't make changes in the InstallUISequence, only in
> the InstallExecuteSequence so using the contents of Properties from the
> UI sequence should be fine. Are you setting your Properties to be
> Secure? If you want to pass information in Properties from the
> InstallUISequence to the InstallExecuteSequence you need to set
> Secure="yes" on those Properties. If you're using XMLFile with
> Action="SetValue" you should be able to use Properties in the Value
> attribute as it is of the Formatted type according to the documentation.
>
> Personally I prefer to use XMLConfig for modifying files I'm putting on
> the target machine but if you paste your code for your XMLFile Element &
> the appropriate Properties (and what you expect them to contain) myself
> or others on the list may be able to see where the problem lies or give
> suggestions on using XMLConfig.
>
> Palbinder Sandher 
> Software Deployment & IT Administrator
> T: +44 (0) 141 945 8500 
> F: +44 (0) 141 945 8501 
>
> http://www.iesve.com 
> **Design, Simulate + Innovate with the <Virtual Environment>**
> Integrated Environmental Solutions Limited. Registered in Scotland No.
> SC151456 
> Registered Office - Helix Building, West Of Scotland Science Park,
> Glasgow G20 0SP
> Email Disclaimer
>
> -----Original Message-----
> From: Stelios Kyprou [mailto:[email protected]] 
> Sent: 07 July 2010 13:23
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] Editing config files after installation
>
> The file is installed by the installer, so i can use [#foo.config].
> When i thought of doing this approach (XMLConfig || XMLFile), i got
> stuck because:
> I want to do the foo.config editing after a specific dialog, i.e
> EnterConfigurationDlg, so that i can grab the PROPERTIES from that
> dialog and put them in foo.config.
>
> Following the WiX tutorial at:
> http://www.tramontana.co.hu/wix/lesson6.php#6.10
> did not really help with my senario...
>
> Any ideas?
>
> Stelios
>
> Pally Sandher wrote:
>   
>> If the file is installed as part of your installation you can simply 
>> use it's Id as a Property e.g. [#foo.config] if you set 
>> Id="foo.config" in it's File element (see -> 
>> http://msdn.microsoft.com/en-us/library/aa368609.aspx). Use that 
>> Property as the path for either XMLConfig or XMLFile to make your 
>> changes to the file.
>>
>> If it's put on the target machine by some other means & you can locate
>>     
>
>   
>> the file using normal methods such as RegistrySearch 
>> (http://wix.sourceforge.net/manual-wix3/wix_xsd_registrysearch.htm),
>> DirectorySearch
>> (http://wix.sourceforge.net/manual-wix3/wix_xsd_directorysearch.htm) 
>> or FileSearch
>> (http://wix.sourceforge.net/manual-wix3/wix_xsd_filesearch.htm) then 
>> do so to set your Property for XMLConfig/XMLFile. You will need no 
>> Custom Actions in either of these cases which should make your code 
>> much more resilient.
>>
>> If you can't locate the file using normal methods then a Custom Action
>>     
>
>   
>> which sets a Property containing the path to the file is your only 
>> option.
>>
>> How is this file installed on the target system initially? If it's by 
>> another product you can usually use a RegistrySearch to find something
>>     
>
>   
>> like the InstallLocation & extrapolate the rest of the path from
>>     
> there.
>   
>> If you're really lucky & the other products authors thought about this
>>     
>
>   
>> ahead of time there may be a standard registry key set by their 
>> installer for you to grab the location from.
>>
>> Avoid using Custom Actions unless you have no other option.
>>
>> Palbinder Sandher
>> Software Deployment & IT Administrator
>> T: +44 (0) 141 945 8500
>> F: +44 (0) 141 945 8501
>>
>> http://www.iesve.com
>> **Design, Simulate + Innovate with the <Virtual Environment>** 
>> Integrated Environmental Solutions Limited. Registered in Scotland No.
>> SC151456
>> Registered Office - Helix Building, West Of Scotland Science Park, 
>> Glasgow G20 0SP Email Disclaimer
>>
>> -----Original Message-----
>> From: Stelios Kyprou [mailto:[email protected]]
>> Sent: 07 July 2010 11:34
>> To: General discussion for Windows Installer XML toolset.
>> Subject: [WiX-users] Editing config files after installation
>>
>> Hello,
>> I suppose this question was asked before, but i couldn't find a clear 
>> answer for it:
>>
>> When an installer runs on the target machine, and installs all the 
>> files in the InstallDir, i would like to carry some extra actions.
>> -Get a config file that was installed, i.e foo.config.
>> -Modify that file (which is in xml format), by adding some values in 
>> the key/value pairs.
>>
>> Now as far as i know from the search i've done, i can only do this 
>> after InstallFinalize, because that is when the files are showing in 
>> the InstallDir.?
>>
>> What is the ideal way of doing this?
>> i.e:
>> -are there built in wix methods to grab foo.config?
>> -should i use the "util:XmlFile" tag for the editing?
>> -what are the general steps for doing this process? e.g put all the 
>> steps in a custom action and call it after InstallFinalize?
>>
>> Thanks in advance,
>> Stelios
>>
>> --
>> Stelios Kyprou
>> Systems Engineer
>> Formicary - delivering quality financial technology solutions(TM) 
>> www.formicary.net
>>
>>
>> ----------------------------------------------------------------------
>> --
>> ----
>> This message is confidential and may be privileged. It is intended 
>> solely for the named addressee. If you are not the intended recipient,
>>     
>
>   
>> please inform us.
>> Any unauthorised dissemination, distribution or copying hereof is 
>> prohibited.
>>
>> Formicary Limited registered office in England and Wales, address 1 
>> Taillar Road, Hedon, East Yorkshire HU12 8GU, registration number 
>> 3894343, VAT number 747644304, does not guarantee that the integrity 
>> of this communication has been maintained nor that this communication 
>> is free of viruses, interceptions or interference.
>> ----------------------------------------------------------------------
>> --
>> ----
>>
>> ----------------------------------------------------------------------
>> --
>> ------
>> This SF.net email is sponsored by Sprint What will you do first with 
>> EVO, the first 4G phone?
>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>> _______________________________________________
>> WiX-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/wix-users
>>
>>
>>
>> ----------------------------------------------------------------------
>> -------- This SF.net email is sponsored by Sprint What will you do 
>> first with EVO, the first 4G phone?
>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>> _______________________________________________
>> WiX-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/wix-users
>>   
>>     
>
> --
> Stelios Kyprou
> Systems Engineer
> Formicary - delivering quality financial technology solutions(TM)
> www.formicary.net
>
>
> ------------------------------------------------------------------------
> ----
> This message is confidential and may be privileged. It is intended
> solely for
> the named addressee. If you are not the intended recipient, please
> inform us.
> Any unauthorised dissemination, distribution or copying hereof is
> prohibited.
>
> Formicary Limited registered office in England and Wales, address 1
> Taillar
> Road, Hedon, East Yorkshire HU12 8GU, registration number 3894343, VAT
> number
> 747644304, does not guarantee that the integrity of this communication
> has been
> maintained nor that this communication is free of viruses, interceptions
> or
> interference.
> ------------------------------------------------------------------------
> ----
>
> ------------------------------------------------------------------------
> ------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> WiX-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> WiX-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>   

-- 
Stelios Kyprou
Systems Engineer
Formicary - delivering quality financial technology solutions(TM)
www.formicary.net


----------------------------------------------------------------------------
This message is confidential and may be privileged. It is intended solely for
the named addressee. If you are not the intended recipient, please inform us.
Any unauthorised dissemination, distribution or copying hereof is prohibited.

Formicary Limited registered office in England and Wales, address 1 Taillar
Road, Hedon, East Yorkshire HU12 8GU, registration number 3894343, VAT number
747644304, does not guarantee that the integrity of this communication has been
maintained nor that this communication is free of viruses, interceptions or
interference.
----------------------------------------------------------------------------

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to