Is there a "ZIP project" in Visual Studio?

Stef Heyenrath picture Stef Heyenrath · Jan 25, 2011 · Viewed 7.1k times · Source

In Visual Studio there are several "Setup and Deployment" projects, one of these is "CAB Project".

http://i55.tinypic.com/21cxaoi.png

But I actually want a simple "ZIP Project" which enables me to add some folders + dll's from my solution and package this all in a zip file for easy distribution on the web.

  • Is there such a project type ?

  • When I want to create this by myself, what resources and references should I use to build this ?

Edit
@Cheeso
I created a dummy 'class library' project which has dependencies on all the sub projects. In this dummy project I used the post-build event to zip the dll's using 7-zip. But I was hoping that there was a better solution for this.

Answer

Ergwun picture Ergwun · Feb 8, 2011

The MSBuild Extension Pack offers some compression tasks you could use.

For example, edit your project file, uncommenting the 'AfterBuild' target and including an appropriate compression task that packages up the content you want.

<Project>
  ...
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  -->
  <Target Name="AfterBuild">
    <ItemGroup>
      <!-- Set the collection of files to Zip-->
      <FilesToZip Include="C:\YourContent\*"/>
    </ItemGroup>

    <MSBuild.ExtensionPack.Compression.DNZip TaskAction="Create" CompressFiles="@(FilesToZip)" ZipFileName="C:\YourZipFile.zip"/>
  </Target>
</Project>