I've been a WinRAR user for a long time. I like everything about the program: it has a well-designed GUI, rich command line interface, great compression, and good speed. The only problem is that I frequently need to use something like WinRAR in the workplace to automate backups via scripts and even though WinRAR licenses are cheap, I'm usually instructed to use a free alternative. Enter 7-Zip.
Don't get me wrong, I am an open-source supporter but 7-Zip is very clunky in comparison to WinRAR. The GUI lacks many of the features accessible via command line and while creating a SFX archive is a snap in WinRAR, it is a horrible experience in 7-Zip. To create a SFX archive in WinRAR you just check the appropriate box, go to the SFX options and pick amongst the plethora of options you want for the SFX archive, all of which are very intuitive. The 7-Zip GUI has an SFX option, but all it does is make an EXE that extracts itself to the directory the EXE is contained in. If you want to do something like build a compressed installer that extracts the archived files to a temporary folder and then calls a given EXE file to begin the installation after extraction here is what you have to do:
- Create a regular 7-Zip archive of the installation files.
- Create a text file in the same path as the 7Z file called config.txt containing specific syntax that describes the EXE file you want to call after extraction. This file must be saved in UTF-8 format, not the normal Windows ANSI format.
- Get the 7-Zip extras package, which is buried in the downloads and can be difficult to find.
- Copy the 7zS.sfx file from the 7-Zip extras package to the same location as the 7Z and config.txt file
- At the command line, run the command copy /b 7zS.sfx + config.txt + <archive name>.7z <desired sfx file name>.exe
It's just not intuitive at all. Worse, the instructions for this were all from a third party, not from the 7-Zip documentation! It's very confusing, as the main 7-Zip program contains a file called 7z.sfx, but if you try to use that instead of the 7zS.exe file from the extras package, double-clicking the EXE will just open a dialog asking you where you would like to extract the files.
And there is one nasty oversight in the design. Rather than asking 7-Zip to archive files at a specific location or all files under a specific location, you can create a text file containing a specific list of files to archive. But there is a catch: when it creates the archive, all the files from the list will just be placed at the root of the archive no matter where they are in the file system. This means there can't be any duplicate names and it also means you lose the folder hierarchy within the archive.
This is a problem, because what I am doing at present is writing a PowerShell script that archives log files from the Microsoft IIS web server that are older than a certain number of days. My script was working great until I encountered a web server that had multiple web sites running on it (and hence multiple log subdirectories). I modified my script to accommodate more than one directory, but ran dead up against the duplicate file names issue since IIS logs are usually just e_<timestamp>.log. So multiple sites can have log files with the same name.
I've asked around and various people are telling me to just call the parent log folder, but this is no good because it will not only include all log files rather than just those older than a certain number of days, but it will archive logs from other applications that I'm not interested in processing log files for.
This is just stupid design on the part of the 7-Zip programmers. It should place files defined in the list file in the archives in a way that maintains the relative paths and folder hierarchy. The worst part is I found someone had filed a feature request for this issue... in 2006.
Sure, 7-Zip is powerful, free, and provides the best compression there is. But it's usability is some of the worst I've seen in open-source software.