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

Issues with RegDBKetExist (some guid) returning -1

Hello Everyone,

I have been trying to remove a program within an InstallScript project. Currently I look for the GUID within HKEY_LOCAL_MACHINE, but every time I send a key that contains a GUID RegDBKeyExist returns -1.
Here is the code I have tried, I checked that the function would return a 1 by looking for "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall"

Has anyone else run into this issue with an InstallScript project in InstallShield 2013 professional SP1?

//doesn't work
//registry_key = @old_reg_key;
//registry_key = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{b0454189-c155-4f7b-a98d-dcc772213c6b}";
//registry_key = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{b0454189-c155-4f7b-a98d-dcc772213c6b}\\";
//registry_key = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{B0454189-C155-4F7B-A98D-DCC772213C6B}";

//HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{A2122A9C-A699-4365-ADF8-68FEAC125D61} this was for reference to make sure the key was right
registry_key = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{A2122A9C-A699-4365-ADF8-68FEAC125D61}";

//does work
//registry_key = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall";

nSize = -1;
root_key = RegDBGetDefaultRoot();
result = RegDBKeyExist(registry_key);
Labels (1)
0 Kudos
(2) Replies
Level 2

Everything is hunkie-dorie now. Since the system I was checking had a 64bit OS I needed to include
I really wish it was posted in the help documentation for RegDBKeyExist function
0 Kudos
Level 12

RegDBKeyExist does mention it.
0 Kudos