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
- :
- Uninstall Reg Keys
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
‎Nov 03, 2010
11:41 AM
Uninstall Reg Keys
How should one go about creating an installation that does nothing to the registry during initial installation or maintenance, but deletes specified registry keys during uninstall?
The same functionality should work if the uninstall is invoked from the Control Panel or via the InstallShield installation file.
The same functionality should work if the uninstall is invoked from the Control Panel or via the InstallShield installation file.
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 04, 2010
03:54 AM
Which project type do you use?
For Basic MSI you might take a look at the RemoveRegistry Table.
For Basic MSI you might take a look at the RemoveRegistry Table.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 04, 2010
08:59 AM
It is a Basic MSI installation. I've gotten as far as creating a custom action with an InstallShield script that only gets executed during an uninstall. The script first attempts to delete the keys under HKLM and then the keys under HKCU. The keys under HKCU are successfully deleted, but the keys under HKLM fail to delete. It seems as if the uninstall (invoked from the control panel) is not running the script with elevated admin privileges. The installation is being run on Windows 7 x64. And this is the current script:
function DeleteRegKeys(hMSI)
// To Do: Declare local variables.
begin
// HKEY_LOCAL_MACHINE
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
if(RegDBDeleteKey("Software\\Wow6432Node\\My Company") < 0) then
MessageBox("RegDBDeleteKey(Software\\Wow6432Node\\My Company) FAILED", SEVERE);
else
MessageBox("RegDBDeleteKey(Software\\Wow6432Node\\My Company) SUCCEEDED", INFORMATION);
endif;
if(RegDBDeleteKey("Software\\My Company") < 0) then
MessageBox("RegDBDeleteKey(Software\\My Company) FAILED", SEVERE);
else
MessageBox("RegDBDeleteKey(Software\\My Company) SUCCEEDED", INFORMATION);
endif;
// HKEY_CURRENT_USER
RegDBSetDefaultRoot(HKEY_CURRENT_USER);
if(RegDBDeleteKey("Software\\My Company") < 0) then
MessageBox("RegDBDeleteKey(Software\\My Company) FAILED", SEVERE);
else
MessageBox("RegDBDeleteKey(Software\\My Company) SUCCEEDED", INFORMATION);
endif;
end;
function DeleteRegKeys(hMSI)
// To Do: Declare local variables.
begin
// HKEY_LOCAL_MACHINE
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
if(RegDBDeleteKey("Software\\Wow6432Node\\My Company") < 0) then
MessageBox("RegDBDeleteKey(Software\\Wow6432Node\\My Company) FAILED", SEVERE);
else
MessageBox("RegDBDeleteKey(Software\\Wow6432Node\\My Company) SUCCEEDED", INFORMATION);
endif;
if(RegDBDeleteKey("Software\\My Company") < 0) then
MessageBox("RegDBDeleteKey(Software\\My Company) FAILED", SEVERE);
else
MessageBox("RegDBDeleteKey(Software\\My Company) SUCCEEDED", INFORMATION);
endif;
// HKEY_CURRENT_USER
RegDBSetDefaultRoot(HKEY_CURRENT_USER);
if(RegDBDeleteKey("Software\\My Company") < 0) then
MessageBox("RegDBDeleteKey(Software\\My Company) FAILED", SEVERE);
else
MessageBox("RegDBDeleteKey(Software\\My Company) SUCCEEDED", INFORMATION);
endif;
end;
![](/skins/images/A5EADE085F77DE82FB3B14D6B307AE6A/responsive_peak/images/icon_anonymous_message.png)