My installer created with MS WiX installs a component (some files) into an existing folder in the user's App Data directory. This existing folder is empty. Thus, when uninstalling, the installer will remove this folder - which it shouldn't do. So how to prevent this?
The code is:
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="LocalAppDataFolder" Name="AppData">
<Directory Id="OtherCompanysFolder" Name="OtherCompany">
<Directory Id="OtherProductsFolder" Name="Product">
<Directory Id="AddOnsFolder" Name="AddOns">
<Directory Id="MyAddOnFolder" Name="MyAddOn">
</Directory>
</Directory>
</Directory>
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment Id="AddOnFiles">
<ComponentGroup Id="ProductComponents" Directory="MyAddOn">
<Component Id="ProductComponent" Guid="{xxx}">
<RegistryKey Root="HKCU" Key="Software\$(var.Manufacturer)\$(var.Product)">
<RegistryValue Type="string" Value="" KeyPath="yes" />
</RegistryKey>
<RemoveFolder Id="RemoveMyAddOnFolder" On="uninstall" Directory="MyAddOnFolder" />
<RemoveFolder Id="RemoveAddOnsFolder" On="uninstall" Directory="AddOnsFolder" />
<RemoveFolder Id="RemoveOtherProductsFolder" On="uninstall" Directory="OtherProductsFolder" />
<RemoveFolder Id="RemoveOtherCompanysFolder" On="uninstall" Directory="OtherCompany" />
<File Id="Executable" Source="path\to\My.exe" />
</Component>
</ComponentGroup>
</Fragment>
The problem is, if I remove the nodes
<RemoveFolder Id="RemoveAddOnsFolder" On="uninstall" Directory="AddOnsFolder" />
<RemoveFolder Id="RemoveOtherProductsFolder" On="uninstall" Directory="OtherProductsFolder" />
<RemoveFolder Id="RemoveOtherCompanysFolder" On="uninstall" Directory="OtherCompany" />
The Light and Ice will complain:
error LGHT0204 : ICE64: The directory AddOnsFolder is in the user profile but is not listed in the RemoveFile table.
Keepting these nodes makes Light and Ice happy, but it will remove AddOnsFolder (which it shouldn't do).
Any ideas what I could do?
PS: In the comment section it was recommended to suppress the error message with a flag (-sice:ICE64). This is NO solution. While the installer now compiles, the AddOn folder is still removed (which must not happen)