As explained here - http://msdn2.microsoft.com/en-us/library/ms867088.aspx#pk_topic6 - the PFXImportCertStore() function creates a new key container for a private key but does not delete it. WiX calls this function when scheduling the deferred action to install certificates and because of this orphaned private key files are created.
In addition, uninstalling a certificate that has an associated private key does not delete that key.
The attached patch addresses both issues - it's not the prettiest bit of code but it works.
Patch to address orphaned private keys.
Logged In: YES
user_id=991639
Originator: NO
Used the bit to remove the key containers automatically.
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 15 days (the time period specified by
the administrator of this Tracker).
Original fix, while small, only works on Vista. Which is sad. Reactivating bug.
Did the removal by hand. More code but things work on XP again.
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 15 days (the time period specified by
the administrator of this Tracker).