visual-studiovisual-studio-2017visual-studio-setup-proje

Visual Studio Setup Project - how to avoid duplicate entries?


It's the first time I use Visual Studio Setup to create an installer, and there's one thing I don't understand.

I've added the files I want via simple drag-and-drop, but the end result is that the installer creates a lot of duplicate entries, like this:

enter image description here

in other words, for almost every one of my .dll files, Visual Studio adds a duplicate .DLL file with the same name, that cannot even be deleted.

While the final generated installer still works correctly (because I assume one of the duplicates is overwriting the other) it has the annoying side-effect of generating a lot of warnings and also of making the final .MSI file almost twice as big as it needs to be.

How do I avoid this?


Solution

  • From your brief description in your comment, it's unclear how/why the duplicate DLLs are appearing. But if you want to tweak what's been added, you have a few options.

    1. If you want to remove a DLL from the Application Folder, you can try to select the Application Folder from the left pane then right-click the DLL to see if a Delete option appears. If it does, you can delete it that way.

    2. If the DLL has dependencies, you will need to remove it another way: Go to the Setup Project entry in Solution Explorer and you will possibly see DLLs listed under it. Also, expand the Detected Dependencies list to see likely more DLLs. You can cherry-pick which DLLs you want to exclude by right-clicking a specific DLL and selecting Exclude. When you exclude successfully, the list of DLLs in your Application Folder pane will be shortened.

    This advice should get you past your current roadblock.