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

REGDB_UNINSTALL_NAME error

I have a basic MSI project in which I am trying to manually remove a desktop icon through a custom action (because it was created via a custom action and will not delete during uninstall). I am using the following function which just returns an error when I try to get the displayName from the uninstall key in the registry. I am doing it this way because the product name is dynamically set at install time and I need to retrieve the displayName during uninstall to remove the shortcut.

RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);

if (RegDBGetItem(REGDB_UNINSTALL_NAME, szShortcutName) < 0) then
MessageBox("Unable to get shortcut name", SEVERE);
else
DeleteFolderIcon(FOLDER_DESKTOP, szShortcutName);
endif;

Any ideas on why the RegDBGetItem function is failing? I have the condition set to REMOVE="ALL" and I have tried putting the execute sequence in several different places from beginning to end.
Labels (1)
0 Kudos
1 Reply
MSIYER
Level 8

I do not think your CA runs with appropriate rights. HKLM is always a high security zone.

If your install runs elevated, try using the Deferred in System Context option for your CA.

Also, make sure your icon install CA is not called in the uninstall.
0 Kudos