cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
lewischris
Level 2

Preserving .NET app.config values in upgrade

Hi,

I'm totally new to Installshield, so please go easy! I have seen several other threads relating to dynamically changing .NET configs, but none seem to answer my specific needs. I am using an evaluation copy if IS 2008 Premier, and intend to purchase if I can get this to work.

We have a .NET application (WinForms) on public release that we need to upgrade (major or minor - to be determined). Certain users have made changes to their app.config file and we need to retain those changes somehow - either by keeping the old config intact, or by extracting the values we need (before uninstall/upgrade) and updating the new config.

I have seen several examples of how to update the XML, but I don't know how to read values from the existing XML config file, store them somehow then write the values into the new config?

Can anyone advise?

Thanks,

Chris

ps. We have previously been using the Wise Studio (current version) which has been problematic with several bugs and glitches. My initial impression of IS is that it is a much more polished product.
Labels (1)
0 Kudos

(3) Replies
klacounte
Level 6

Chris,

You'll need to write a custom action to read the XML values. Then you can save the values in properties and use those properties to write the values back using the Xml File Changes view.
0 Kudos
KathyMorey
Level 10

Have you tried using AppSearch to put the values you need into properties? I've done that for simple data in an XML file.
0 Kudos
lewischris
Level 2

Thanks for your replies.

One problem we have is that the previous install was not created in Installshield, and on machines where the app is installed the INSTALLDIR is not stored where it should be in the registry - it's blank! So searching for the existing config file would involve file-searching the whole machine, which we don't want to do.

Also, the previous installer system we used (I think it was VS.NET 2003) named the components using GUID type names which we want to try to remove and replace.

Essentially we are looking for a way to remove everything that is installed EXCEPT the config file, then replace with the new components. We are currently looking at Minor upgrade package as a patch.

Chris
0 Kudos