- NSIS Discussion
- Zipping up a directory
Archive: Zipping up a directory
Afrow UK
21st May 2003 21:01 UTC
Zipping up a directory
I am looking for something that will zip up a specified directory in the standard zip compression method.
I need this to use for people making D-Day maps, where my app currently copies all used files involved with their map to an output directory.
Does anyone know of one lying around which I could run like a command-line program, to zip up the dir, without the user having to do anything?
-Stu
Joel
21st May 2003 21:45 UTC
Maybe here.
I don't think there is a plugin to do that.
So an alternative commandline tool. to use with
"!System"
Joost Verburg
21st May 2003 21:51 UTC
http://www.info-zip.org/
Afrow UK
21st May 2003 22:13 UTC
Ok thanks.
That will work great!
But I can't find out how to get it to include whole directories.
Can anyone shed some light upon this :)
-Stu
Afrow UK
21st May 2003 22:26 UTC
I'm going to use 7zip's compression util, simply because it's just one exe file.
Look's like I'm going to have to make up a files list instead, because I'm unable to zip up a whole directory.
-Stu
crisp
19th June 2003 16:00 UTC
Hi Afrow.
I looking for a function to build a File List a directory (i'm a bit in a hurry ;)). I wonder if you allready did that.
The idea is to make a file list text file with everything that has to be included in a NSIS instalation kit.
Thanks
Crisp
Sunjammer
19th June 2003 16:03 UTC
Use FindFirst, FindNext and FindClose to find the files matching a wildcard in a given directory, then use FileOpen, FileWrite and FileClose to write the results to a text file. Docs can be found here. Searching for FindFirst on the Archive could be useful too.
Afrow UK
19th June 2003 21:17 UTC
There is a far far better solution to zipping up a directory without having to create a files-list.
Here is what I did:
File /oname=$INSTDIR\7za.exe 7za.exe
nsExec::Exec "$INSTDIR\7za.exe a -tzip -r dir.zip *" ;zip up dir
nsExec::Exec "$INSTDIR\7za.exe d $INSTDIR\dir.zip 7za.exe" ;remove 7za.exe
Because the 7za.exe file is in the directory in which you want to zip up (it has to be) then it gets added into the zip file too.
The second execution removes the 7za.exe file from the zip file leaving the fresh zip.
-Stu
Joost Verburg
19th June 2003 22:18 UTC
Using 7-zip (with support for many compression methods) is a bit overkill for only zip. Why not use Info-Zip or another application? It's way smaller.
Afrow UK
20th June 2003 16:29 UTC
Originally posted by Joost Verburg
Using 7-zip (with support for many compression methods) is a bit overkill for only zip. Why not use Info-Zip or another application? It's way smaller.
I asked on this forum for a zip-up program, and I only had one reply saying "use 7-zip"
I searched for other command-line apps for zipping up stuff, but I never found one.
-Stu