I have a component that performs several XmlConfig actions: one upon installation and one upon removal:
<Component Id="machine.config.Update" Guid="573DF5B0-438D-498d-8919-C4B96835C1EF">
<RegistryKey Root="HKLM" Key="[REGISTRYKEY]\Settings\[TITLE]" Action="createAndRemoveOnUninstall">
<RegistryValue Action="write" Type="integer" Name="MACHINEMEMORYLIMIT" Value="1" KeyPath="yes"/>
</RegistryKey>
<util:XmlConfig
Id="CacheNode.memoryLimit.add"
File="[WindowsFolder]\Microsoft.NET\[FRAMEWORKDIR]\v2.0.50727\CONFIG\machine.Config"
Action="create"
ElementPath="/configuration/system.web/processModel"
Name="memoryLimit"
Node="value"
On="install"
Value="90" />
<util:XmlConfig
Id="CacheNode.memoryLimit.remove"
File="[WindowsFolder]\Microsoft.NET\[FRAMEWORKDIR]\v2.0.50727\CONFIG\machine.Config"
Action="delete"
ElementPath="/configuration/system.web/processModel"
VerifyPath="/configuration/system.web/processModel"
Name="memoryLimit"
Node="value"
On="uninstall" />
</Component>
The component is part of a patch that I can install and rollback. The problem is that when a patch is deleted, the delete action does not work. The odd part is that the same XmlConfig action is executed if I change it as On="install". I see that the registry key is correctly deleted when deleted. Why does the XmlConfig action also fail? I checked the logs and did not see any errors or explanations why this did not happen.
Update:
The XmlConfig action works when fully uninstalled. Just do not roll back the patch.
source