I have a wix setup project which creates a ProgramMenu shortcut and a Desktop shortcut. I am able to remove these shortcuts by using RemoveFolder.
<!-- To remove Desktop shortcut -->
<RemoveFolder Id="RemoveDesktopFolder" Directory="DesktopFolder" On="uninstall"/>
<!-- To remove ProgramMenu shortcut-->
<RemoveFolder Id="CleanUpShortCut" Directory="ApplicationProgramsFolder" On="uninstall" />
However, on uninstall, I also want to be able to clear the current user's LocalAppData. More specifially, Users\CurrentUser\AppData\Local\my_application
So far, I have figured out that the RemoveFolder does not remove files recursively and that I would have to use util:RemoveFolderEx. This is how I have done it:
<Directory Id="LocalAppDataFolder" Name="Local">
<Directory Id="RemoveLocalData" Name="my_application">
<Component Id="RemoveLocalAppData" Guid="PUT-GUID-HERE">
<util:RemoveFolderEx On="uninstall" Property="RemoveLocalData"/>
<RemoveFolder Id="RemoveLocalData" On="uninstall"/>
</Component>
</Directory>
</Directory>
And I get this error:
ICE38: Component RemoveLocalAppData installs to user profile. It must use a registry key under HKCU as its KeyPath, not a file.
I figure I am not using RemoveFolderEx properly, but I do not know the right way in this case to clear my LocalAppData.
Note, I do not create the folder during installation. Instead, this [LocalAppData]\my_application is created post-installation at run-time by the application.