Eric Bourque
Eric Bourque

Reputation: 174

C# VS2017 Community - How to automatically ZIP the output folder of a project

Does anyone know of a way easy way to automatically ZIP the Debug/Release folder after build and copy that ZIP to another folder?

Upvotes: 1

Views: 1102

Answers (2)

Eric Bourque
Eric Bourque

Reputation: 174

This solution will use 7-Zip to zip the output files to the solutions folder.

Create this zipper.bat file and place it in your solution folder:

"C:\Program Files\7-Zip\7z" a -y -tzip %2 %1 -mx5

echo done

Add this line to your Post-build events:

call "$(SolutionDir)zipper.bat" "$(TargetDir)" "$(SolutionDir)zipped.zip"

Upvotes: 1

Nekeniehl
Nekeniehl

Reputation: 1691

No, there is no easy way, AFAIK, you can either use a .bat file and call it on the post-build event, or you can use a MSBuild Script or FAKE to use F# as scripting.

Upvotes: 1

Related Questions