【发布时间】:2017-12-11 19:16:53
【问题描述】:
我创建了一个安装程序来升级我们的软件,但由于某种原因,升级时删除了 XML 配置文件(我们软件的那些)。
如果软件的所有功能都升级了,就会出现这种情况。 我们的软件是存档类型的东西。如果我只安装该功能并升级它,一切都很好。
但是,如果我安装存档随附的所有服务并升级它们,那么所有配置文件(并且每个都位于不同的文件夹中!)都消失了。
举个例子:
<ComponentGroup Id="AutoArchiveTool" Directory="AutoArchiverFolder">
<Component Id="C_AutoArchivingTool_Gateway_exe_config" NeverOverwrite="yes" Guid="{A62D5200-FDE0-4DA1-A04A-7FBDACEA83B2}">
<File Id="F_AutoArchivingTool_Gateway_exe_config" Source="$(var.Gateway.TargetDir)Gateway.exe.config" KeyPath="yes"/>
</Component>
... more script
</ComponentGroup>
如果您记录安装程序,您甚至可以看到它被识别为“永不覆盖”:
Disallowing installation of component: {A62D5200-FDE0-4DA1-A04A-7FBDACEA83B2} since the keyfile exists and the component is marked to never overwrite existing installations
但升级后它就消失了。我错过了什么? 我已经看到了“永久”属性,但这不是我想要的。我希望安装程序在升级期间单独保留配置文件。删除后不要留下它们(配置文件)。
【问题讨论】:
-
我认为如果您什么都不做,如果用户在安装后对其进行了修改,它不会覆盖。 msdn.microsoft.com/en-us/library/windows/desktop/…
标签: wix windows-installer upgrade