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

时间:2022-02-23 22:45:18

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"?

任何人都可以建议“安装过程中配置更改的最佳实践”吗?

1 个解决方案

#1


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.

InstallShield使用MSXML来执行更新,这是DOM的行为。如果这对您来说是不可接受的,那么您必须假装它不是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.

多年来一直争论的另一个最佳实践是这种配置是否属于安装程序。我一直这样做,但有很多不会/不会。他们坚持要求在应用程序中保持配置;通常在第一次运行时完成。

#1


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.

InstallShield使用MSXML来执行更新,这是DOM的行为。如果这对您来说是不可接受的,那么您必须假装它不是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.

多年来一直争论的另一个最佳实践是这种配置是否属于安装程序。我一直这样做,但有很多不会/不会。他们坚持要求在应用程序中保持配置;通常在第一次运行时完成。