Wix 当软件使用主要升级@neveroverwrite和@permanent时,如何在卸载时删除配置文件
主要升级和配置文件是软件的常见组件 主要升级声明:Wix 当软件使用主要升级@neveroverwrite和@permanent时,如何在卸载时删除配置文件,wix,windows-installer,wix3.9,Wix,Windows Installer,Wix3.9,主要升级和配置文件是软件的常见组件 主要升级声明: <MajorUpgrade DowngradeErrorMessage="A newer version of $(var.AppName) is already installed." AllowSameVersionUpgrades="yes" /> 在进行主要升级时,不应删除或覆盖配置文件。配置文件必须保留。这是通过以下声明实现的: <Component Id="MyConfigComponent" NeverO
<MajorUpgrade DowngradeErrorMessage="A newer version of $(var.AppName) is already installed." AllowSameVersionUpgrades="yes" />
在进行主要升级时,不应删除或覆盖配置文件。配置文件必须保留。这是通过以下声明实现的:
<Component Id="MyConfigComponent" NeverOverwrite="yes" Permanent="yes" Guid="MY-GUID-HERE">
<File Id="MyConfigOutput" KeyPath="yes" Name="MyConfig.config" Source="..\MyApp\MyConfig.config.bak"/>
</Component>
卸载时如何删除文件MyConfig.config
使用类似于
的声明将在升级时删除配置文件。因此,它不能用于此目的。这同样适用于RemoveFolderEx
。我必须使用什么来代替?您必须编写一个自定义操作来手动删除文件/目录,并计划在“$config\u file\u component=2且不升级ProductCode”的条件下执行它。这将在删除配置文件组件(在卸载或修改过程中)时触发自定义操作,但不作为升级过程中卸载过程的一部分