We have a setup project that currently adds Project Output\'s from different visual studio projects. We want to change the packaging system and use a folder with a bunch of
I finally found a real solution to this problem. What I needed is to add all files in a given external directory, (which is not part of the project), to the setup project in build time, i.e. if a file is added to that external directory, it will be included automatically in the installer with the next build.
What I did is I created a new project in the solution (Class Library project) and removed everything from it: Class1.cs, AssemblyInfo.cs, and the relevant ItemGroups of the csproj file containing
elements for the files above and the
elements for the includes.
Then, I added a new ItemGroup:
PreserveNewest
This way, this new project does not contain any files, but it referencing all the files (recursively, indicated by the \**\
from the indicated directory) as Content files.
So, upon build, these files are treated as Content files, therefore copied to the output directory of the new project.
So, why did I do all the above? Just because, Setup Project has an option to include the Content files from another project!
So, this way you can make arbitrary external files "part" of the solution without actually listing them, the list of the files is evaluated in build time, and then reference them from a Setup project.