Click here to Skip to main content
15,897,891 members
Articles / Desktop Programming / WPF

Zip My Code

Rate me:
Please Sign up or sign in to vote.
4.78/5 (17 votes)
20 Dec 2009CPOL3 min read 72.1K   2K   48  
A utility stripping your source code to the essential core and then compressing it to a nice CodeProject article attachment.
@echo off

set MSBuild=%systemroot%\Microsoft.NET\Framework\v3.5\MSBuild.exe

set SourceDir=ZipMyCode\bin\Release
set ZipMyCode=%SourceDir%\ZipMyCode.exe
set SharpZipLib=%SourceDir%\ICSharpCode.SharpZipLib.dll
set Plossum="%SourceDir%\Plossum CommandLine.dll"
set C5=%SourceDir%\C5.dll

set NETZDir=netz\bin\Release
set NETZ=%NETZDir%\netz.exe
set defcomp=netz\compress\defcomp.dll
set zip=netz\compress\zip.dll

set NETZTarget=%SourceDir%\ZipMyCode.exe.netz\ZipMyCode.exe

echo Building...
%MSBuild% ZipMyCode.sln /property:Configuration=Release /v:q

echo Packing into one assembly...
copy /y %defcomp% %NETZDir%
copy /y %zip% %NETZDir%
%NETZ% -s -z -w %ZipMyCode% %SharpZipLib% %Plossum% %C5%

echo.
echo Moving assembly...
move /y %NETZTarget% .

pause

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer Axis Communications
Sweden Sweden
Got my first computer in the 90's and loved it even though it sounded like a coffeemaker.

Now getting paid for designing cool applications, and drinks the coffee instead of listening to it being made.

Comments and Discussions