How to delete a folder inside %AppData% with wix?

2019-07-20 05:43发布

I created an application that creates some folders in the APPDATA dir, I want those folders to be deleted when my application is uninstalled. But I don't seem to be able to do it. After several tries and searches I ended up using the SearchDirectory property.

What I am doing wrong?

<Feature Id="ProductFeature" Title="Test" Level="1">
  ...
  <ComponentRef Id="DeleteAppData" />
</Feature>

<Property Id="APPLICATIONDATAFOLDER">
  <DirectorySearch Id="Search" Path="[AppDataFolder]Test" AssignToProperty="yes" />
</Property>

<Fragment>
  ...
  <!-- Delete APPDATA folder -->
  <Component Id="DeleteAppData" Directory="AppDataFolder" Guid="###">
    <util:RemoveFolderEx Id="RemoveAppData" On="uninstall" Property="APPLICATIONDATAFOLDER" />
  </Component>
</Fragment>

标签: wix
0条回答
登录 后发表回答