Wix 如何在卸载而不是升级时删除文件?
我希望使用以下声明在卸载时删除文件:Wix 如何在卸载而不是升级时删除文件?,wix,windows-installer,wix3.9,Wix,Windows Installer,Wix3.9,我希望使用以下声明在卸载时删除文件: <Component Id="RemoveFilesComponent" Directory="BIN" KeyPath="yes" Guid="MY-GUID-HERE"> <RemoveFile Id="RemoveTxtFile" Directory="BIN" Name="file.txt" On="uninstall" /> </Component> 如何在元素RemoveFile中重写On=“unin
<Component Id="RemoveFilesComponent" Directory="BIN" KeyPath="yes" Guid="MY-GUID-HERE">
<RemoveFile Id="RemoveTxtFile" Directory="BIN" Name="file.txt" On="uninstall" />
</Component>
如何在元素RemoveFile
中重写On=“uninstall”
,使文件在升级时不会被删除(替换)
其他信息:文件
file.txt
必须通过声明RemoveFile
明确删除,因为它是应用程序生成的文件。听起来类似于几天前的问题-@jbudreau:“如何在卸载时而不是升级时删除文件?”以及“如何在主要升级中保留配置文件?”是完全不同的问题。据我所知,您必须编写一个自定义操作来删除该文件,并将其设置为“$=2”而不是UPGRADINGPRODUCTCODE“。RemoveFile表无法检测卸载与升级。@jbudreau:非常感谢您的回答。我将尝试这种方法。
<MajorUpgrade DowngradeErrorMessage="A newer version of $(var.AppName) is already installed." AllowSameVersionUpgrades="yes" />