Thx for  your fast answer

Ok - sorry for the unclear description. I didn't want to make it long -
let's do it more descriptive:
Here's the scenario (I'll use simplify pseudo code for the app.config):

I have my application version 1.0.0 with app.config:
<configuration>
<databaseConfig>
    <add key="Server" value="localhost\MyDbEngine" />
    <add key="Database" value="MyDb" />
 </databaseConfig>
</configuration>

The user gets the app and installs it. He changes the values as he's
pleased. 
(i.e. he changes 
    <add key="Server" value="localhost\MyDbEngine" />
    <add key="Database" value="FancyUserDbName" />
)
Now there is the next version 1.0.1 with app.config:

<configuration>
<databaseConfig>
    <add key="Server" value="localhost\MyDbEngine" />
    <add key="Database" value="MyDb" />
</databaseConfig>
<newSection>
    <add key="newKey" value="newValue" />
</newSection>
</configuration>

Users gets the installer (1.0.1). What I want it to do is install the
program preserving the values from .config file that already existed in the
previous version (1.0.0) and adding all the new ones. I wouldn't like the
user being forced to write the "FancyUserDbName" once again to the file (or
in the installer).

As I understood from your answer there is a way to extract required values
from the .config file that is being installed, show them in installers UI
and allow the user to edit it and write the effect into the final .config
file. 
1. If it is right could you write a bit more on how to do it? Or maybe some
link to read about it? I am especially concern in the way of accessing the
file that is being installed.

2 .Would it be also possible to use both the new .config file (in my example
version 1.0.1) and the old one (1.0.0) together to fill the data in UI
accordingly to my needs?

3. Finaly is it possible to skip editing the values by the user and just
merge the new and old files? (I don't expect the wix to know how to merge
them - but maybe it is possible to do it via Custom Action?)



cemiles wrote:
> 
> You'll probably have to write up a dialog and have some edit fields set to
> properties and pass those values entered onto the util:xmlconfig element.
> That's been my approach.  Maybe I'm on the wrong track on what you are
> trying to do...
> 
> On Tue, Sep 9, 2008 at 10:32 AM, Chad Miles <[EMAIL PROTECTED]> wrote:
> 
>> You can update the config file during the UI sequence and modify
>> keys/values.  Is that all you're trying to do?
>>
>> util:xmlconfig  element
>>
>>
>> On Tue, Sep 9, 2008 at 10:26 AM, polan <[EMAIL PROTECTED]> wrote:
>>
>>>
>>> I have some application settings (like database configuration etc.)
>>> stored
>>> in
>>> app.config file.
>>> As it is a standard .Net approach i haven't expected any troubles with
>>> this
>>> and installer. I would like to make the newest version of the program
>>> available to the users via wix installer,  but I couldn't find a simple
>>> way
>>> of updating the .config file without trashing the old settings values.
>>> The perfect solution for me would be a way to merge somehow the old file
>>> with the new one.
>>>
>>> I am thinking about several possible approaches (don't know if all are
>>> possible)
>>>
>>> 1. Compare and merge old and new .config files using Custom Action
>>> A problem with this one is I can't get to access the new file (the one
>>> that's gona be installed)
>>>
>>> 2. Backup old file using Custom Action and merge the backup with the
>>> freshly
>>> installed version using another (deferred) Custom Action
>>>
>>> 3. Instead of copying the .config file from source move creating it to
>>> the
>>> wix (using XmlConfig or XmlFile tag)
>>> Don't know how to write conditional set/create values - is it possible?
>>>
>>> 4. There is some other obvious way, which I can not see maybe?
>>>
>>>
>>> So in Your opinion what is the best approach for updating the .config
>>> file
>>> during the update/upgrade?
>>> Would moving some values from app.config to registry be better?
>>> --
>>> View this message in context:
>>> http://n2.nabble.com/Updating-app.config-tp1077780p1077780.html
>>> Sent from the wix-users mailing list archive at Nabble.com.
>>>
>>>
>>> -------------------------------------------------------------------------
>>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>>> challenge
>>> Build the coolest Linux based applications with Moblin SDK & win great
>>> prizes
>>> Grand prize is a trip for two to an Open Source event anywhere in the
>>> world
>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>> _______________________________________________
>>> WiX-users mailing list
>>> WiX-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/wix-users
>>>
>>
>>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
> world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/Updating-app.config-tp1077780p1077897.html
Sent from the wix-users mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to