PDA

View Full Version : RegDBQueryKey cannot get all sub keys



Yibing
07-23-2013, 10:25 PM
Hi all,

Thanks a lot in advance for any possible help!

I am using InstallShield professional edition with an evaluation license. The problem I have is that RegDBQueryKey function get cannot find all the sub keys of a registry key.

My codes are:

function RemoveTarmaInstallation(hMSI)
// To Do: Declare local variables.
STRING szKey, szName, svValue, szMsg;
NUMBER nvType, nvSize;
LIST listNames;
begin
// To Do: Write script that will be executed when MyFunction is called.
if (RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE) < 0) then
MessageBox ("RegDBSetDefaultRoot failed", SEVERE);
endif;

szKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
if (RegDBKeyExist(szKey) < 0) then
SprintfBox (INFORMATION, "Error", "Non-existing key: %s", szKey);
return;
endif;

listNames = ListCreate(STRINGLIST);
if (RegDBQueryKey(szKey, REGDB_KEYS, listNames) < 0) then
SprintfBox (INFORMATION, "Error", "failed to query key: %s", szKey);
return;
else
SdShowInfoList("INFO", "value names", listNames);
endif;

end;

The running result is:
10153

Is there any special reason for those keys don't show up?

Regards!

Yibing
07-24-2013, 12:17 AM
I have just figured out the reason.

I tried to read the 64 bit registry keys in my 32 bit installer without setting the registry options. After add the following to my code, everything is OK now:

REGDB_OPTIONS = REGDB_OPTIONS | REGDB_OPTION_WOW64_64KEY;