[wix-users] WcaAddTempRecord fails with dbError=1 (MSIDBERROR_DUPLICATEKEY)

Phill Hogland phill.hogland at rimage.com
Thu Oct 13 12:42:29 PDT 2016

My QA tester wants to do some more testing but so far my plan to also pass the key name into the fifth parameter to be used as the Primary Key for the temporary row seems to be working.  We are  at a stage in our release cycle where I will probably have to complete the release before I can try to recompile against a private build for testing. Thanks for the advice.

From: wix-users <wix-users-bounces at lists.wixtoolset.org> on behalf of Bob Arnson <bob at firegiant.com>
Sent: Thursday, October 13, 2016 2:30:51 PM
To: WiX Toolset Users Mailing List
Subject: Re: [wix-users] WcaAddTempRecord fails with dbError=1 (MSIDBERROR_DUPLICATEKEY)

The uniquifier should start with a semi-random number (tick count) and go up by one on every call. You might look at adding debug logging to wcawrap.cpp to log each field (which would be generally useful and also capture the uniquified field).

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Phill Hogland
Sent: Thursday, 13 October, 2016 15:18
To: wix-users at lists.wixtoolset.org
Subject: [wix-users] WcaAddTempRecord fails with dbError=1 (MSIDBERROR_DUPLICATEKEY)

I have a semi-custom action which is intermittently failing and the dbError code indicates that the Primary Key was not uniquified as expected.  I used the code in gaming.cpp (~line 585), in the wix3 source, as the example for my implementation.

The curious thing is that this code was implemented about nine months ago, and like the example in gaming.cpp, I call the WcaAddTempRecord twice, with the same string in the fifth parameter, for each call.  In my case it was L"DcomPerms", as that is the name for the underlying Compiler Extension.  Aall this has been working fine until I recently modified the code to make a third call to WcaAddTempRecord, with the same fifth parameter.

The results seem to be somewhat random, but primary when testing on win7 x64 the CA fails with MSIDBERROR_DUPLICATEKEY reported.

As an experiment I changed my approach to provide a different sting in the fifth parameter (the Primary Key to the Registry table) and while more testing is needed, so far I have not seen this failure mode.  Does this observation indicate a bug (or limitation) in the WcaAddTempRecord uniquify code?  Or is there other advise on how to avoid this problem?

Thanks for any assistance.


WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/

WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/

More information about the wix-users mailing list