0

I'm using Windows 7 64, VS 2013.

I'm trying to create an MSI installer that contains 2 C# applications distributed in 2 different folders, both folders are containing 1 DLL file that is the same. I am adding all necessary dependencies, everything seems fine, but after installing, one of the applications throws an error regarding loading of that DLL.

My assumption is that the VS installer project keeps the files in a common folder and when it sees the same file it automagically refers both application to use the same exact DLL.

My work-around for this problem is to rename the DLL when adding it into installer project and make a small .bat script that renames the DLL after installation. This works, but I'm guessing there's a more elegant way to do it besides having scripts run at install/uninstall time that will rename some DLLs.

Biffen
  • 6,249
  • 6
  • 28
  • 36
Lucian
  • 874
  • 11
  • 33
  • 1
    WiX and VS Installer are two different authoring tools for windows installer. – Christopher Painter Mar 24 '15 at 14:44
  • 1
    Don't rename the file after it's been installed! If you do a repair of your installed product Windows will just restore it. I'm pretty sure VS doesn't do what you describe, and the error you describe seems to be a path search issue, or finding the wrong Dll or a Dll with a missing dependency somewhere. I'd try to discover exactly what that issue is before applying a solution. – PhilDW Mar 24 '15 at 16:40
  • What's the error? You could get a list of which folders are looked in when running the application using [assembly binding logging](http://stackoverflow.com/a/17682082/2226988). – Tom Blodget Mar 25 '15 at 02:28

1 Answers1

2

Strictly speaking, Windows Installer has something called the component rules. One aspect of this is that a given file in a given folder can only belong to one component. The same files in two different folders would be two different components because a component can only define files for one folder.

WiX creates MSI and has a feature called smart cabbing where the file would be normalized when compressed into a cab and embedded into the MSI.

Visual Studio installer projects are of very low quality and will killed by Microsoft before being brought back to live as an add on. It has horrible dependency scanning and you are finding that the "automagical" behavior doesn't work very well.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100