卸载我的应用程序时,我想删除应用程序添加的文件夹。卸载程序似乎只删除了最初从 MSI 文件安装的目录和文件。如何删除应用程序创建的文件夹?
1 回答
0
按照此链接上的说明:
使用 WixUtil 扩展:
<?xml version="1.0" encoding="utf-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" >
然后读取之前存储在注册表中的文件夹路径:
<Property Id="APPLICATIONFOLDER"> <RegistrySearch Key="SOFTWARE\$(var.Manufacturer)\$(var.SkuName)" Root="HKLM" Type="raw" Id="APPLICATIONFOLDER_REGSEARCH" Name="Path" /> </Property>
确保安装程序脚本中包含以下组件:
<DirectoryRef Id="APPLICATIONFOLDER"> <Component Id="CleanupMainApplicationFolder" Guid="*"> <RegistryValue Root="HKLM" Key="SOFTWARE\$(var.Manufacturer)\$(var.SkuName)" Name="Path" Type="string" Value="[APPLICATIONFOLDER]" KeyPath="yes" /> <!-- We need to use APPLICATIONFOLDER variable here or RemoveFolderEx will not remove on "install". --> <util:RemoveFolderEx On="uninstall" Property="APPLICATIONFOLDER" /> </Component> </DirectoryRef>
candle
当您同时调用和时使用 WiXUtil 扩展light
:-ext WixUtilExtension
于 2017-02-03T10:19:06.127 回答