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 deploy files that are prepared for deployment in the setup.
But this means that we need to add the files one by one, and keep adding them on each version when there are new files.
I saw in this question that we can't add files with rules like *.aspx.
So I'm considering creating a small tool that will change the vdproj file based on the files available. Can you help me with the format of this file? It seems there are some GUIDs associated with each file included.
Does anyone have a better solution on how to do this?
We're not thinking about using a different setup tool right just yet, we just look for a simple solution for the file packaging.
To add the entire folder, just open a windows explorer window, then drag all the files you want to add into the file system view.
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 <Compile>
elements for the files above and the <Reference>
elements for the includes.
Then, I added a new ItemGroup:
<ItemGroup>
<Content Include="Path\To\The\Directory\**\*.*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With