[wix-users] Bug when building in x64 : The primary key '' is duplicated in table 'Registry'. Please remove one of the entries or rename a part of the primary key to avoid the collision

Nelu Tharanga nelutharanga at gmail.com
Wed Nov 27 01:14:36 PST 2019


I have a Visual Studio application which I'm building in x64 platform. When
I'm building it in WiX x86 platform it complies without errors (I'm only
switching the WiX project platform, other projects in the solution are kept
in x64), but when I switch WiX platforms to x64 I keep getting the
following error,

The primary key 'regA2B7646C0C125E9CC59F422240E376E4' is duplicated in
table 'Registry'. Please remove one of the entries or rename a part of the
primary key to avoid the collision.

The error points at the following .wsx file;

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Fragment>
        <DirectoryRef
Id="dir_7E6449EC_74EE_433E_AAAD_C82B017D95D1"><Component
Id="com_7E6449EC_74EE_433E_AAAD_C82B017D95D1"
Guid="{CEF697A2-AA55-4FF1-B3D7-E6E2CA3825F7}" Permanent="no"
SharedDllRefCount="no" Transitive="no"><File
Id="_7E6449EC_74EE_433E_AAAD_C82B017D95D1"
Source="..\EasyCntrlImplement\Dependencies\Radial.tlb" Hidden="no"
KeyPath="yes" ReadOnly="no" System="no" TrueType="no"
Vital="yes"><TypeLib Id="{423968A1-C17C-11D0-9082-0060976CDFDC}"
Description="Radial"
HelpDirectory="dir_7E6449EC_74EE_433E_AAAD_C82B017D95D1"
MajorVersion="1" MinorVersion="0" Language="0"><Interface
Id="{423968A2-C17C-11D0-9082-0060976CDFDC}" Name="IRadial"
ProxyStubClassId32="{00020420-0000-0000-C000-000000000046}"
/></TypeLib></File><RegistryValue Root="HKCR"
Key="TypeLib\{423968A1-C17C-11D0-9082-0060976CDFDC}\1.0\0\win64"
Value="[#_7E6449EC_74EE_433E_AAAD_C82B017D95D1]" Type="string"
Action="write" /></Component></DirectoryRef>
    </Fragment>
</Wix>

The Registry table for x64 in the .wixobj is as follows;

<table name="Registry">
	<row sourceLineNumber="C:\Code\Softdev\branches\CAE\Sutra\Source\EasyControl\SetupEasyControl\obj\x64\Release\Harvested
Output\_Radial.com.wsx*4">
		<field>regB9E8FC6EE074D15FBD1108264AA30D19</field>
		<field>0</field>
		<field>Interface\{423968A2-C17C-11D0-9082-0060976CDFDC}</field>
		<field />
		<field>IRadial</field>
		<field>com_7E6449EC_74EE_433E_AAAD_C82B017D95D1</field>
	</row>
	<row sourceLineNumber="C:\Code\Softdev\branches\CAE\Sutra\Source\EasyControl\SetupEasyControl\obj\x64\Release\Harvested
Output\_Radial.com.wsx*4">
		<field>reg5F3E8255D0EB91927047E91970D9E91F</field>
		<field>0</field>
		<field>Interface\{423968A2-C17C-11D0-9082-0060976CDFDC}\TypeLib</field>
		<field />
		<field>{423968A1-C17C-11D0-9082-0060976CDFDC}</field>
		<field>com_7E6449EC_74EE_433E_AAAD_C82B017D95D1</field>
	</row>
	<row sourceLineNumber="C:\Code\Softdev\branches\CAE\Sutra\Source\EasyControl\SetupEasyControl\obj\x64\Release\Harvested
Output\_Radial.com.wsx*4">
		<field>reg422668C39EAE7DDC702B953EEE70BD5C</field>
		<field>0</field>
		<field>Interface\{423968A2-C17C-11D0-9082-0060976CDFDC}\TypeLib</field>
		<field>Version</field>
		<field>1.0</field>
		<field>com_7E6449EC_74EE_433E_AAAD_C82B017D95D1</field>
	</row>
	<row sourceLineNumber="C:\Code\Softdev\branches\CAE\Sutra\Source\EasyControl\SetupEasyControl\obj\x64\Release\Harvested
Output\_Radial.com.wsx*4">
		<field>reg847179D5A3F462997C0DA39052F1D271</field>
		<field>0</field>
		<field>Interface\{423968A2-C17C-11D0-9082-0060976CDFDC}\ProxyStubClsid32</field>
		<field />
		<field>{00020420-0000-0000-C000-000000000046}</field>
		<field>com_7E6449EC_74EE_433E_AAAD_C82B017D95D1</field>
	</row>
	<row sourceLineNumber="C:\Code\Softdev\branches\CAE\Sutra\Source\EasyControl\SetupEasyControl\obj\x64\Release\Harvested
Output\_Radial.com.wsx*4">
		<field>reg88FA7C52A17F1377F29868A82C4A406A</field>
		<field>0</field>
		<field>TypeLib\{423968A1-C17C-11D0-9082-0060976CDFDC}\1.0</field>
		<field />
		<field>Radial</field>
		<field>com_7E6449EC_74EE_433E_AAAD_C82B017D95D1</field>
	</row>*	<row sourceLineNumber="C:\Code\Softdev\branches\CAE\Sutra\Source\EasyControl\SetupEasyControl\obj\x64\Release\Harvested
Output\_Radial.com.wsx*4">
		<field>regA2B7646C0C125E9CC59F422240E376E4</field>
		<field>0</field>
		<field>TypeLib\{423968A1-C17C-11D0-9082-0060976CDFDC}\1.0\0\win64</field>
		<field />
		<field>[#_7E6449EC_74EE_433E_AAAD_C82B017D95D1]</field>
				<field>com_7E6449EC_74EE_433E_AAAD_C82B017D95D1</field>
	</row>*
	<row sourceLineNumber="C:\Code\Softdev\branches\CAE\Sutra\Source\EasyControl\SetupEasyControl\obj\x64\Release\Harvested
Output\_Radial.com.wsx*4">
		<field>regC30AF68C4AF3DC1E27535C5D585108FA</field>
		<field>0</field>
		<field>TypeLib\{423968A1-C17C-11D0-9082-0060976CDFDC}\1.0\FLAGS</field>
		<field />
		<field>0</field>
		<field>com_7E6449EC_74EE_433E_AAAD_C82B017D95D1</field>
	</row>
	<row sourceLineNumber="C:\Code\Softdev\branches\CAE\Sutra\Source\EasyControl\SetupEasyControl\obj\x64\Release\Harvested
Output\_Radial.com.wsx*4">
		<field>reg4B9497E7A2DC80508CE2CD49E9284A48</field>
		<field>0</field>
		<field>TypeLib\{423968A1-C17C-11D0-9082-0060976CDFDC}\1.0\HELPDIR</field>
		<field />
		<field>[dir_7E6449EC_74EE_433E_AAAD_C82B017D95D1]</field>
		<field>com_7E6449EC_74EE_433E_AAAD_C82B017D95D1</field>
	</row>*	<row sourceLineNumber="C:\Code\Softdev\branches\CAE\Sutra\Source\EasyControl\SetupEasyControl\obj\x64\Release\Harvested
Output\_Radial.com.wsx*4">
		<field>regA2B7646C0C125E9CC59F422240E376E4</field>
		<field>0</field>
		<field>TypeLib\{423968A1-C17C-11D0-9082-0060976CDFDC}\1.0\0\win64</field>
		<field />
		<field>[#_7E6449EC_74EE_433E_AAAD_C82B017D95D1]</field>
		<field>com_7E6449EC_74EE_433E_AAAD_C82B017D95D1</field>
	</row>*
</table>

The x86 has the following;

<table name="Registry">
	<row sourceLineNumber="C:\Code\Softdev\branches\CAE\Sutra\Source\EasyControl\SetupEasyControl\obj\Release\Harvested
Output\_Radial.com.wsx*4">
		<field>regB9E8FC6EE074D15FBD1108264AA30D19</field>
		<field>0</field>
		<field>Interface\{423968A2-C17C-11D0-9082-0060976CDFDC}</field>
		<field />
		<field>IRadial</field>
		<field>com_7E6449EC_74EE_433E_AAAD_C82B017D95D1</field>
	</row>
	<row sourceLineNumber="C:\Code\Softdev\branches\CAE\Sutra\Source\EasyControl\SetupEasyControl\obj\Release\Harvested
Output\_Radial.com.wsx*4">
		<field>reg5F3E8255D0EB91927047E91970D9E91F</field>
		<field>0</field>
		<field>Interface\{423968A2-C17C-11D0-9082-0060976CDFDC}\TypeLib</field>
		<field />
		<field>{423968A1-C17C-11D0-9082-0060976CDFDC}</field>
		<field>com_7E6449EC_74EE_433E_AAAD_C82B017D95D1</field>
	</row>
	<row sourceLineNumber="C:\Code\Softdev\branches\CAE\Sutra\Source\EasyControl\SetupEasyControl\obj\Release\Harvested
Output\_Radial.com.wsx*4">
		<field>reg422668C39EAE7DDC702B953EEE70BD5C</field>
		<field>0</field>
		<field>Interface\{423968A2-C17C-11D0-9082-0060976CDFDC}\TypeLib</field>
		<field>Version</field>
		<field>1.0</field>
		<field>com_7E6449EC_74EE_433E_AAAD_C82B017D95D1</field>
	</row>
	<row sourceLineNumber="C:\Code\Softdev\branches\CAE\Sutra\Source\EasyControl\SetupEasyControl\obj\Release\Harvested
Output\_Radial.com.wsx*4">
		<field>reg847179D5A3F462997C0DA39052F1D271</field>
		<field>0</field>
		<field>Interface\{423968A2-C17C-11D0-9082-0060976CDFDC}\ProxyStubClsid32</field>
		<field />
		<field>{00020420-0000-0000-C000-000000000046}</field>
		<field>com_7E6449EC_74EE_433E_AAAD_C82B017D95D1</field>
	</row>
	<row sourceLineNumber="C:\Code\Softdev\branches\CAE\Sutra\Source\EasyControl\SetupEasyControl\obj\Release\Harvested
Output\_Radial.com.wsx*4">
		<field>reg88FA7C52A17F1377F29868A82C4A406A</field>
		<field>0</field>
		<field>TypeLib\{423968A1-C17C-11D0-9082-0060976CDFDC}\1.0</field>
		<field />
		<field>Radial</field>
		<field>com_7E6449EC_74EE_433E_AAAD_C82B017D95D1</field>
	</row>*	<row sourceLineNumber="C:\Code\Softdev\branches\CAE\Sutra\Source\EasyControl\SetupEasyControl\obj\Release\Harvested
Output\_Radial.com.wsx*4">
		<field>reg545F59592A2C5492DA792F4683833A15</field>
		<field>0</field>
		<field>TypeLib\{423968A1-C17C-11D0-9082-0060976CDFDC}\1.0\0\win32</field>
		<field />
		<field>[#_7E6449EC_74EE_433E_AAAD_C82B017D95D1]</field>
		<field>com_7E6449EC_74EE_433E_AAAD_C82B017D95D1</field>
	</row>*
	<row sourceLineNumber="C:\Code\Softdev\branches\CAE\Sutra\Source\EasyControl\SetupEasyControl\obj\Release\Harvested
Output\_Radial.com.wsx*4">
		<field>regC30AF68C4AF3DC1E27535C5D585108FA</field>
		<field>0</field>
		<field>TypeLib\{423968A1-C17C-11D0-9082-0060976CDFDC}\1.0\FLAGS</field>
		<field />
		<field>0</field>
		<field>com_7E6449EC_74EE_433E_AAAD_C82B017D95D1</field>
	</row>
	<row sourceLineNumber="C:\Code\Softdev\branches\CAE\Sutra\Source\EasyControl\SetupEasyControl\obj\Release\Harvested
Output\_Radial.com.wsx*4">
		<field>reg4B9497E7A2DC80508CE2CD49E9284A48</field>
		<field>0</field>
		<field>TypeLib\{423968A1-C17C-11D0-9082-0060976CDFDC}\1.0\HELPDIR</field>
		<field />
		<field>[dir_7E6449EC_74EE_433E_AAAD_C82B017D95D1]</field>
		<field>com_7E6449EC_74EE_433E_AAAD_C82B017D95D1</field>
	</row>*	<row sourceLineNumber="C:\Code\Softdev\branches\CAE\Sutra\Source\EasyControl\SetupEasyControl\obj\Release\Harvested
Output\_Radial.com.wsx*4">
		<field>regA2B7646C0C125E9CC59F422240E376E4</field>
		<field>0</field>
		<field>TypeLib\{423968A1-C17C-11D0-9082-0060976CDFDC}\1.0\0\win64</field>
		<field />
		<field>[#_7E6449EC_74EE_433E_AAAD_C82B017D95D1]</field>
		<field>com_7E6449EC_74EE_433E_AAAD_C82B017D95D1</field>
	</row>*
</table>

looks like instead of
"TypeLib{423968A1-C17C-11D0-9082-0060976CDFDC}\1.0\0\win32", WiX just
duplicated the "TypeLib{423968A1-C17C-11D0-9082-0060976CDFDC}\1.0\0\win64"
twice.
If I change the whole application platform to x86 (instead of just choosing
x86 for WiX) only one row for
"TypeLib{423968A1-C17C-11D0-9082-0060976CDFDC}\1.0\0\win32" appears (the
one for win64 is not created)

How do I get around this bug?

I'm using,
WiX Toolset v3.11.2.4516
Visual Studio professional 2017 - vs 15.9.11
Wix Toolset Visual Studio extension - 1.0.04


More information about the wix-users mailing list