MSBuild - Zip a zip file

Oct 11, 2012 at 2:35 PM

I have tried to zip a zip file with msbuild zip but I cant get it to work. What am I doing wrong?

 

I have done this

<Target Name="BuildZip">
        <ItemGroup>
            <!-- All files from build -->
            <ZipFiles Include="..\..\Deploy\*.*"/>
        </ItemGroup>
        <MakeDir Directories="..\..\DeployTest" Condition="!Exists('$(..\..\DeployTest')" />
        <Zip Files="@(ZipFiles)"
             WorkingDirectory="Deploy\"
             ZipFileName="..\..\DeployTest\IronEditor-Build.zip"
             ZipLevel="9" />
    </Target>



and also tried this

   <Target Name="Zip">
        <CreateItem Include="..\..\Deploy\*.*" >
            <Output ItemName="ZipFiles" TaskParameter="Include"/>
        </CreateItem>
        <Zip ZipFileName="YourZipFile.zip" WorkingDirectory="..\..\Deploy\*.*" Files="@(ZipFiles)" />
    </Target>

 

It creates a empty zip file

Coordinator
Oct 11, 2012 at 3:17 PM

Hi

That's not the MSBuild Extension Pack zip task. The syntax for the MSBuild Extension Pack zip task can be found here http://www.msbuildextensionpack.com/help/4.0.5.0/html/f2118b59-554e-d745-5859-126a82b1df81.htm

 

Mike

Oct 11, 2012 at 3:35 PM

oh. I have now change to what you say...but it says it cant find

MSBuild.ExtensionPack.Compression.Zip

 

Do you have any idea where that would be? The only thing I find is a msbuild folder with this

C:\Program Files\MSBuild\ExtensionPack\4.0

but there is no zip in it.

Coordinator
Oct 11, 2012 at 4:21 PM

do you have the import in your msbuild file?

 

<Import Project="$(MSBuildExtensionsPath)\ExtensionPack\4.0\MSBuild.ExtensionPack.tasks"/>


Marked as answer by mikeFourie on 5/26/2014 at 10:02 AM
Oct 12, 2012 at 7:26 AM

Yes. That was it. Thank.