cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Yibing
Level 3

RegDBQueryKey cannot get all sub keys

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:


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

Regards!
Labels (1)
0 Kudos
(1) Reply
Yibing
Level 3

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;
0 Kudos