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

RegDBDeleteKey command not working

Hi All,

I am using Installshield 2009.
I am creating a registry value while installing my application. I am doing it as below -
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
RegDBSetKeyValueEx ("SOFTWARE\\MyCompany\\MyApp", "ServerName", REGDB_STRING, szServerName, -1);

Where I am taking 'szServerName' as input from user.

This is working fine. But when my application will be uninstalled, I want to remove this key from registry and I am using following code for the same.
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
RegDBDeleteKey("SOFTWARE\\MyCompany\\MyApp\\ServerName");

But the key is not getting deleted. Am I doing something wrong here?
One more thing I dont want to use "RegDBCreateKeyEx" command for creating the required registry key.

Thanks in Advance
Thanks
Sandeep
Labels (1)
0 Kudos
(1) Reply
kaneohe
Level 6

Try using RegDBDeleteValue instead. You're can't delete a value with RegDBDeleteKey. Your key is "MyApp", not "ServerName".
0 Kudos