Home » Questions » Computers [ Ask a new question ]

How to add a root folder to files archived with 7zip

How to add a root folder to files archived with 7zip

I want to create a distribution archive of my code that includes a subset of directories and excludes all the subversion files. I would like the files to be added to the archive with a root folder that identifies the version of the release, so that when the archive is unzipped it will use this root folder (i.e. myAppV1.3)

Asked by: Guest | Views: 74
Total answers/comments: 2
Guest [Entry]

"Based on info and inspiration provided by Johannes Rössel, (basically that the compression applications don't support what I'm trying to do), I've come up with a more elegant way to resolve my specific scenario. While this doesn't solve the named root folder in an archive issue, it may provide people who come in search of an answer a different way at looking at their own problem.

My solution to get around the 3 step archiving process was to replace the first two steps with a Source Control checkout (by tag) into a named folder.

This is a much more elegant solution as is how I should have been attacking the problem in the first place (as it ensures that the final distribution matches what is in source control)."
Guest [Entry]

"You could do it as two step process

export source code from subversion into a directory with a set name
use 7-zip to pack that directory

svn export path-to-repository root-dir-name
7za a name-of-archive root-dir-name

Root-dir-name is name of directory into which you will export the files.

In your example you would do

svn export path-to-repository MyAppV1.3

This will export only your project's sources into directory named MyApp1.3, while omitting all subversion diles. After this use 7-zip to create archive.

7za a MyAppV1.3.zip MyAppV1.3

This will make zip archive from the folder where you exported the source. The archive will have files in root directory named MyAppV1.3. You could of course use 7z as extension to get better compression.

For command line SVN client I recommend SlickSVN."