我们的 wix 声明中有以下文件夹结构:
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder" Name="$(var.ProgramFilesFolder)">
<Directory Id="ManufacturerFolder" Name="$(var.Manufacturer)">
<Directory Id="APPLICATIONFOLDER" Name="$(var.AppFolderName)">
// further folders or files
</Directory>
</Directory>
</Directory>
</Directory>
目标:我们要在卸载时删除 APPLICATIONFOLDER。RemoveFolderEx
并且RemoveFolder
不适用于此任务,因此我们需要使用 CustomAction。自定义动作:
<CustomAction Directory="ManufacturerFolder" ExeCommand='/c rmdir /S /Q "[APPLICATIONFOLDER]"' Id="RemoveAppFolder" Execute="deferred" Impersonate="no" Return="ignore"/>
此自定义操作不会删除任何内容。什么是正确的声明?