This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- RegDBDeleteKey command not working
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Aug 27, 2010
08:19 AM
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
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
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Aug 31, 2010
01:38 PM
Try using RegDBDeleteValue instead. You're can't delete a value with RegDBDeleteKey. Your key is "MyApp", not "ServerName".