简体   繁体   English

安装期间XML(.config)的更改(installshield 2010)

[英]XML(.config) change during installation(installshield 2010)

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. 我正在开发installshield 2010应用程序但是'文本文件更改'和'xml文件更改'不适合修改配置文件(包括app.config),因为不支持应用条件(如“if”语句)和make元素(属性) )在xml文件中的顺序已修复。

Could anyone suggest "The Best Practices in configuration change during installation"? 有人可以建议“安装过程中配置更改的最佳实践”吗?

InstallShield uses MSXML to do it's updates and this is the behavior of the DOM. InstallShield使用MSXML来执行更新,这是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. 如果这对您来说是不可接受的,那么您必须假装它不是XML并使用Text Changes模式或编写您自己的自定义操作。

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. 既然您询问了“最佳实践”,那么我会说有效的XML是有效的XML,如果您担心手动编辑它的人员的可读性,那么如果他们不能正确理解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. 让我想起了1990年代的一个老笑话,那个用户在得知INI文件是什么时就知道这个玩家已经足够危险了。

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. 通常在首次运行时完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM