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
- :
- Re: Delete a registry Key
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
‎Jul 28, 2006
05:01 PM
Delete a registry Key
Anyone know a way of deleting a key like:
[HKEY_CLASSES_ROOT\some\value]
I use a 'Windows Registry Update' action to create it - but it doesn't get removed un un-install becuase the values change in here after installing!!!
Thanks,
Tom
[HKEY_CLASSES_ROOT\some\value]
I use a 'Windows Registry Update' action to create it - but it doesn't get removed un un-install becuase the values change in here after installing!!!
Thanks,
Tom
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 31, 2006
01:41 PM
If nothing else, in the Uninstall sequence perhaps launch regedit.exe silently with a .reg file with contents like this:
REGEDIT4
[-HKEY_CLASSES_ROOT\some\value]
The hyphen before the key name indicates Regedit should delete the key. Use with caution, naturally.
REGEDIT4
[-HKEY_CLASSES_ROOT\some\value]
The hyphen before the key name indicates Regedit should delete the key. Use with caution, naturally.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 01, 2006
02:20 AM
use the InstallScript function
RegDBDeleteKey (HKEY_CLASSES_ROOT\\some\\value);
or
VBScript function
i = WShell.RegDelete("HKEY_CLASSES_ROOT\\some\\value")
RegDBDeleteKey (HKEY_CLASSES_ROOT\\some\\value);
or
VBScript function
i = WShell.RegDelete("HKEY_CLASSES_ROOT\\some\\value")
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 01, 2006
11:05 AM
Here how to do it in InstallShield Script...
From your example, the line of code would be this...
///////////////////////////////////////////////////////////////////////////////
// My_DeleteRegistryKey //
///////////////////////////////////////////////////////////////////////////////
function My_DeleteRegistryKey(strKey)
begin
return My_DeleteRegistryKeyEX(HKEY_LOCAL_MACHINE, strKey);
end;
///////////////////////////////////////////////////////////////////////////////
// My_DeleteRegistryKeyEX //
///////////////////////////////////////////////////////////////////////////////
function My_DeleteRegistryKeyEX(nRoot, strKey)
STRING strTemp;
NUMBER nResult;
begin
RegDBSetDefaultRoot (nRoot);
m_strLastError = "";
strTemp = "";
nResult = 0;
nResult = RegDBDeleteKey(strKey);
if nResult < 0 then
m_strLastError = "Couldn't Delete Registry Key: \""+ strKey +"\"";
Sprintf(strTemp, "...ERROR: Couldn't Delete Registry Key: \"%s\"\n...ERROR: Result:= %d", strKey, nResult);
endif;
end;
From your example, the line of code would be this...
My_DeleteRegistryKeyEX(HKEY_CLASSES_ROOT, "some\\value");