title: How to diagnose/manage DLL hell with InstallShield?
body: <p>We use InstallShield to build installers for a number of very similar products, each of which has shared files parked in fixed directories underneath our vendor directory.  We have a DLL hell problem that I thought installers should handle.</p>
  
  <p>Imagine products A and B both have file FOO, installed in directory D. FOO isn't necessarily a DLL; it can be any file.</p>
  
  <p>In an ideal world, both copies of FOO are identical and when both products are installed FOO gets (overwritten) in D and everything is fine. And that's how it seems to work when everything is identical. </p>
  
  <p>In practice, A and B may be from different generations, so in fact A has FOO variant A (FOO_a) and B has variant FOO_b.  Now only one of FOO_a or FOO_b will end up in D if both products are installed, and consequently one of A or B will be confused because the wrong file is there.</p>
  
  <p>What I would have expected from installers (and InstallShield) is that for each product P installed on a system, that a reference counter would be kept somewhere (the registry?) regarding each installed file.  So when A is installed and FOO(_a) is placed, FOO is marked as belonging to A, and has reference count set to 1.  If B is now installed with an FOO_b identical to FOO_a, FOO should be marked as belonging also to B, and the reference count incremented.   If B is installed, and FOO_b is different than FOO_a, I'd expect the installer to complain that incompatible files FOO were being proposed for installation and the install should abort.  When a product is de-installed, I'd expect reference counters for each installed file to be decremented, and the installed file only removed when the reference count goes to zero.</p>
  
  <p>That's not what InstallShield appears to do.  It simply smashes FOO into its target directory during an install.  This is in effect the same thing as DLL hell.  Is this the intended behavior of installers?  Of InstallShield? Of Windows?</p>
  
  <p>We thought we looked for a way to ask InstallShield to manage this, but can't find anything.  I'd be pleased to have somebody tell where to look to configure this correctly.  Or is it that InstallShield can't/won't do this? [If so, why am I giving them money?]</p>