WIX - 如何使用 RemoveFiles [英] WIX - How to use RemoveFiles
问题描述
我们有多个配置文件.根据选择的环境,正确的文件被复制,其余的文件应该被删除.
我正在使用 RemoveFile
但这不会删除任何内容,或者可能是我没有正确使用它.有人可以举个例子,在安装过程中,在所有文件都被复制后,从 [INSTALLDIR]
中删除 *.config
.
We have multiple configuration files. Based on the environment selected, right file gets copied and the rest of the files should get deleted.
I am using RemoveFile
but that doesn't delete anything or may be I am not using it right. Can someone give an example to delete *.config
from [INSTALLDIR]
during the install, after all files have been copied.
推荐答案
在下面的例子中 RemoveFile
用于在卸载时删除所有图标(.lnk
扩展名),也将使用 RemoveFolder
In the example below RemoveFile
is used to delete all icons (.lnk
extension) on uninstallation, also the parent folder will be removed by using RemoveFolder
<DirectoryRef Id="DirName">
<Component Id="cmpName" Guid="{429BC364-BE5F-4EC8-9AB9-8A522F8EC089}">
<RemoveFile Id="removeDesktopShortcuts" On ="uninstall" Name="*.lnk"/>
<RemoveFolder Id="RemoveFolder1" On="uninstall"/>
</Component>
</DirectoryRef>
这篇关于WIX - 如何使用 RemoveFiles的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!