cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
alexsd1
Level 3

registry key not deleted

I'm creating 2 registry keys with a specific component under my Main App. This component's contents are only installed with Vista. The Uninstall setting is set to Yes. The files installed by that component are being removed during the app's uninstallation, but the 2 registry keys are not.

I was going to attempt a RegDBDeleteKey(), but the instructions for that function explain it's better to use Registry view in InstallShield for the sake of being neat. But, only the registry values when right clicked have the Remove during uninstall option, the keys do not.

It's imperative these keys get uninstalled when the app is removed.

Any ideas?
Labels (1)
0 Kudos
(6) Replies
alexsd1
Level 3

Hell, I can't even get RegDBDeleteKey() to work.

I created an export function as per the InstallShield help:

*************************************************
export prototype ExFn_RegDBDeleteKey(HWND);

function ExFn_RegDBDeleteKey(hMSI)
STRING szKey, szClass, szKeyRoot, szMsg, svLogFile;
NUMBER nResult1, nResult2, nRootKey;

begin
// Set up parameters for call to RegDBCreateKeyEx.
nRootKey = HKEY_LOCAL_MACHINE;

if (RegDBSetDefaultRoot (nRootKey) < 0) then
MessageBox ("RegDBSetDefaultRoot failed.", SEVERE);
else
MessageBox ("RegDBSetDefaultRoot failed.", SEVERE);
endif;

// Call RegDBDeleteKey to delete the key just created.
if (RegDBDeleteKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\{D58809CA-65AF-4ec9-A985-E264EEDBE54D}") < 0) then
MessageBox ("RegDBDeleteKey failed.", SEVERE);
else
MessageBox ("RegDBDeleteKey success.", SEVERE);
endif;
end;
**********************************************************

I tried calling this function during the Main App's OnUninstalling and OnUninstalled, and the function never fires.

I'm at a loss. This project is from a recent upgrade from InstallShield Professional 7 project. Can that have some effect? Maybe I'll just start from scratch, it's not a big project.
0 Kudos
alexsd1
Level 3

Wow.

Created a new project from scratch. Now one of the keys is being deleted, but the other is not.

For this new project, I created a new registry set in the System Configuration > Registry window and did an import reg file. Then went to Organization > Setup Design > Main App > My Component > Registry Data and added the just created registry set into my components Registry Set Install Conditions.

Why would one reg key from a registry set be deleted and one not?

The one that didn't is in 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\' if that makes a difference.

The uninstallation is working, because the dll that the aforementioned key is referencing is deleted. But, I'd hate to leave a reference in my Credential Provider key. At least it's not like a GINA key where the OS blows up if the dll is gone, but the key remains.

If anybody can help, I'd appreciate it!
0 Kudos
Ranjit_Kumar
Level 6

Have u tried by seleting uninstall entire key option in the registry.
0 Kudos
alexsd1
Level 3

Ranjit Kumar wrote:
Have u tried by seleting uninstall entire key option in the registry.


i don't follow. is that a registry key setting in installshield?
0 Kudos
packagechief
Level 5

alexsd1 wrote:
i don't follow. is that a registry key setting in installshield?


Correct

see example attached where you can set the option for the behavior

if you right click on the approriate reg key you (see example attached where you can set the option for the behavior) can choose what shoud happen with the reg key

for your problem i think the option "Install if Absent, Uninstall if present" shoud be the right choice

which means, Installshield Setup Manager creates the key file if it dosen't exists on the target while setup is running and otherwise kill it, if its present on the target
0 Kudos
packagechief
Level 5

Update:

if you do an uninstall of the application IS takes of course automatically care to delete the key if its possible
0 Kudos