安装期间 XML(.config) 更改(installshield 2010)
我正在开发 installshield 2010 应用程序,但“文本文件更改”和“xml 文件更改”不适合修改配置文件(包括 app.config),因为不支持应用条件(如“if”语句)并且使元素(属性) xml 文件中的顺序已修复。
有人可以建议“安装期间配置更改的最佳实践”吗?
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"?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
InstallShield 使用 MSXML 进行更新,这是 DOM 的行为。如果这对您来说是不可接受的,那么您将不得不假装它不是 XML 并使用文本更改模式或编写您自己的自定义操作。
既然您询问了“最佳实践”,我会说有效的 XML 就是有效的 XML,如果您担心手动编辑它的人的可读性,那么如果他们不能正确理解 XML,也许他们不应该手动编辑它。
让我想起 1990 年代的一个老笑话,讲的是当用户了解 INI 文件是什么时,他所知道的只是危险的。
多年来一直争论的另一个最佳实践是这种配置是否属于安装程序。我一直这样做,但也有很多人不这样做/不会这样做。他们坚持在应用程序中保留配置;通常在第一次运行时完成。
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.