cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Flexera beginner

Not deleting all files in INSTALLDIR on uninstall

Installing is working as intended, but not all the files are deleted when uninstalling it.

How to delete all files in INSTALLDIR when uninstalling it. 

Labels (1)
0 Kudos
4 Replies
Intrepid explorer

Re: Not deleting all files in INSTALLDIR on uninstall

Are the components for the files that are not getting removed 'Shared' Components?

By default, InstallShield marks new components as 'Shared'. Often this is not necessary. In a perfect world it should not matter. But in reality, the Reference Counts for the shared components can get messed up, resulting in the files not getting removed on uninstall. Unfortunately, once this happens, you need to clean up the registry keys that contain the errant reference counts.

0 Kudos
Flexera beginner

Re: Not deleting all files in INSTALLDIR on uninstall

@rguggisberg 

Could you explain this, "once this happens, you need to clean up the registry keys that contain the errant reference counts" in more detail? 

What I have to find in registries and what I have to do on it?

0 Kudos
Intrepid explorer

Re: Not deleting all files in INSTALLDIR on uninstall

From the InstallShield Help:

"A file’s reference count (also referred to as refcount) is the number of products on a target system that use the file. Reference counts help to ensure that if multiple products are sharing a file, the file remains on the target system until all of the products that share it are removed.

Reference counts for shared files are stored in the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs

Both Windows Installer–based projects and InstallScript-based projects include support for managing the reference counts for shared files. The functionality is slightly different, depending on the project type."

Find the keys for your product under

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs

Note that all of your 'Shared' components will have a registry entry and the 'Value' should be 1 (Reference Count). Those that have a higher Value are the ones that won't get removed when you uninstall. Somehow these got corrupted. To fix: (ASSUMING THESE FILES ARE NOT REALLY SHARED)

  1. Uninstall your product
  2. Backup the registry
  3. Delete all of the registry entries for your product that you find under the above key

You should change 'Shared' to "No" for all components that are not shared. Otherwise this will happen again some day!

LMK how it goes.

0 Kudos
Intrepid explorer

Re: Not deleting all files in INSTALLDIR on uninstall

I should have added that you will need to manually delete the files that did not get uninstalled.

Things should work properly for next install/uninstall.

 

0 Kudos