0

I'm developing installshield 2010 application but 'text file change' and 'xml file change' is not good to modifying configuration file(include app.config) because applying condition(like "if" statement) is not supported and make element(attribute) order in xml file fixed.

Could anyone suggest "The Best Practices in configuration change during installation"?

sjuu
  • 657
  • 1
  • 6
  • 11
  • Can you give an example of the XML before and after? I'm not fully understanding your question as technically attribute order shouldn't matter. – Christopher Painter Jan 06 '11 at 16:17
  • technically attribute order shouldn't matter, right. but .config file should be easily modified in our application and should be seen easily. So, element order of original app.config is important. and, xml file changes makes unnecessary close tags. for example, in original .config file. but after import, is changed to . the other thing is, for example, element or attribute should be added or removed if some specefic feature or checkbox is selected. I think it cannot be done by using xml file change only(without script). – sjuu Jan 06 '11 at 20:41
  • In XML and should be identical and it shouldn't matter. Now HTML is a whole different story.... – Christopher Painter Feb 16 '12 at 18:27

1 Answers1

2

InstallShield uses MSXML to do it's updates and this is the behavior of the DOM. If this is unacceptable to you, then you will have to either pretend it isn't XML and use the Text Changes pattern or write your own custom actions.

Since you asked about "best practices" I would say that valid XML is valid XML and if you are worried about readability for people editing it by hand that maybe they shouldn't be editing it by hand if they don't properly understand XML.

Reminds me of the old joke back in the 1990's about the user who knew just enough to be dangerous when he learned what an INI file was.

Another best practice that has been debated over the years is whether this sort of configuration even belongs in the installer. I do it all the time but there are many that don't / won't. They insist on keeping configuration in the application; typically done on first run.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100