Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is _wixCert_{0-9} added to certificate friendly name by WiX?

I am installing some certificates into localStore and for some strange reason all those certs are suffixed with "_wixCert_0" or "_wixCert_1". I've tried to manually remove all the certificates prior install to make sure that there's nothing left, but it still happens. What could be the reason?

This is how i've defined the certificates:

<Component Id="MyCert_file" Guid="*">
    <File Id="MyCert" Name="MyCert.crt" Source="$(var.CertSourceDir)\MyCert.crt" />
</Component>

<Component Id="MyCert" Guid="..." KeyPath="yes">
    <iis:Certificate Id="MyCert"
                     Name="MyCert"
                     Request="no"
                     StoreLocation="localMachine"
                     StoreName="ca"
                     Overwrite="yes"
                     BinaryKey="MyCert"
                     />
</Component>

The certificates get added to the certstore, but they have friendly name like "MyCert_wixCerts_0" and so on. I cannot figure it out why is it happening.

Anyone else does?

like image 969
Jarmo Pertman Avatar asked Dec 31 '10 11:12

Jarmo Pertman


1 Answers

In the WiX source code in src\ca\serverca\scaexec\scacertexec.cpp the InstallCertificatePackage method adds "wixCert" and an increasing unique number to the certificate name before installing it. It looks to be to make sure the name is unique in the certificate store.

The UninstallCertificatePacket method tries to find certificates using the CERTNAME_wixCert_ prefix to find the certificates to uninstall.

There are logging messages in the code that show the certificate names it is installing/uninstalling with the extra stuff added to the name.

like image 95
Brian Walker Avatar answered Oct 22 '22 08:10

Brian Walker