cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Joh4nnes
Level 2

Sporadically recieving Error 5011 - 0x80040707

Hello together,

I am new to these forums and I hope you can help me 🙂

We are creating setups with IS2011 premier edition which are distributed world wide to arround 30000 systems every two month. With the last update we started to recieve more and more cases with the Error 5011 - 0x80040707.

We can see in the LOG-Files that the error occurs when we read from the registry. (I found http://consumerdocs.installshield.com/selfservice/viewContent.do?externalId=Q108167&sliceId=1, but the error also occurs when these keys are correctly set). The value we read from the regestry is there.
After restarting the system the setup is working fine most of the time, it can happen that the error occurs multiple times, but after "some" reboots it works...

e.g. a simple registry query value:
lsEntry = "SYSTEM\\CurrentControlSet\\Services\\D990TRAN";
lnResult = RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
if (lnResult = 0) then
lnResult = RegDBKeyExist(lsEntry);
endif;
if (lnResult < 0) then
szTemp0 = "key not found:" + lsEntry;
return(-1);
endif;
lsEntry = lsEntry ^ "Linkage";
lnResult = RegDBGetKeyValueEx(lsEntry, "Bind", lnValType, lsTemp, lnTemp);

## error occurs e.g. at this point ##

Our Install-Script is very big (over 70000 lines of InstallScript Code). We have the assumption that the error is cause because of some memory problem and we are trying to analyze this at the moment.

Additionally we can 'move' this error to other places in code only by changing the quantity/size of compiled code.

Do you have any other ideas what could be the problem?

Thank you for your help
Johannes
Labels (1)
0 Kudos
(1) Reply
phill_mn
Level 7

In the code snippet that you posted, if one of the earlier RegDB calls fails it will still execute the following code. While I do not know if that is related to the symptoms that you described I would refactor the code more along the lines of:

lsEntry = "SYSTEM\\CurrentControlSet\\Services\\D990TRAN";
lnResult = RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
if (lnResult < ISERR_SUCCESS) then
//set a message or a return code
return(-1);
endif;

lnResult = RegDBKeyExist(lsEntry);
if (lnResult < ISERR_SUCCESS) then
szTemp0 = "key not found:" + lsEntry;
return(-1);
endif;

//lsEntry = lsEntry ^ "Linkage";
// you should not use the ^ operator for registry strings and it might be clearer to debug if a new variable is defined.
lsNewEntry = lsEntry + "\\Linkage"; // see http://kb.flexerasoftware.com/doc/Helpnet/installshield15langref/LangrefAppend_to_path_.htm
lnResult = RegDBGetKeyValueEx(lsNewEntry, "Bind", lnValType, lsTemp, lnTemp);


With regard to your comment that changing the size of your code moves the problem, it is hard to predict what that issue would be. I recently had a random crash, only on Windows 8, in a large mature InstallScript project, which was 'resolved' when working on another problem I discovered that a call to KernelFree was being called improperly on a local script variable. The strange thing was that the invalid call was in the OnFirstUIBefore code and the crash would happen after the SdFinished dialog, so it was difficult to relate the two. But for the symptoms you indicated I would use #if 0/#ifdef and #endif to isolate sections of code that when removed from the project do or do not impact the problem. Divide and conquer.
0 Kudos