使用wix3.10安装程序删除漫游中的文件夹

时间:2017-02-03 09:10:02

标签: wix wix3.10

卸载我的应用程序时,我想删除应用程序添加的文件夹。似乎卸载程序只删除了最初从MSI文件安装的目录和文件。如何删除应用程序创建的文件夹?

1 个答案:

答案 0 :(得分:0)

按照此link

的说明操作
  1. 使用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"
         >
    
  2. 然后读取以前存储在注册表中的文件夹路径:

    <Property Id="APPLICATIONFOLDER">
         <RegistrySearch Key="SOFTWARE\$(var.Manufacturer)\$(var.SkuName)" Root="HKLM" Type="raw" Id="APPLICATIONFOLDER_REGSEARCH" Name="Path" />
    </Property>
    
  3. 确保安装程序脚本中包含以下组件:

    <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>
    
  4. 致电candlelight时使用WiXUtil扩展程序:-ext WixUtilExtension