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

Bob Arnson bob at firegiant.com
Thu Oct 13 12:30:51 PDT 2016


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.

Phill

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


More information about the wix-users mailing list