7-Zip redistribution and LGPL obligations are the conditions that apply when an organisation copies 7-Zip to third parties, modifies its source code, or builds it into a product. 7-Zip is licensed mainly under the GNU Lesser General Public License version 2.1 or any later version. Parts of 7z.dll are under the BSD 3-clause and BSD 2-clause licences, and its RAR code also carries an unRAR licence restriction.[1] The LGPL covers only copying, distribution and modification. Running a program that uses the library is not restricted (rule).[3] The obligations below therefore apply to redistributors and developers, not to organisations that only install 7-Zip internally.
Licence versions
The 7-Zip notice allows redistribution and modification under version 2.1 of the LGPL or, at the recipient’s option, any later version.[1] SPDX uses the identifier LGPL-2.1-or-later for this choice, as opposed to LGPL-2.1-only.[7] The Open Source Initiative publishes the LGPL 2.1 with the Free Software Foundation as steward.[11] The version shipped with the 7-Zip sources is dated February 1999. It was the first release of the Lesser GPL and succeeded the GNU Library General Public License version 2.[3] A copy may also be moved to the ordinary GNU GPL version 2 or later by changing its notices. That change cannot be undone for that copy (rule).[3]
Redistributing unmodified binaries
Redistributions in binary form must reproduce the related licence information from the 7-Zip licence file (rule).[1] The Developer FAQ allows 7-Zip EXE or DLL files to be used in a commercial application if its documentation says three things (rule):[2]
- that parts of the 7-Zip program were used;
- that 7-Zip is licensed under the GNU LGPL;
- where the source code can be found, with a link to www.7-zip.org.
The LGPL requires object-code distribution to be accompanied by the complete corresponding source code. Offering the source from the same place as the object code also meets this requirement (rule).[3] When 7-Zip is shipped on the same medium as unrelated software, the other software does not come under the LGPL just by being on that medium (rule).[3] A redistributor may not add restrictions on the recipients’ LGPL rights, for example through an end-user licence agreement (rule).[3]
Modifying 7-Zip code
LGPL’ed code must remain under the LGPL. If a developer changes 7-Zip code, or compiles a wrapper around it into a DLL, the source of that DLL must be licensed under the LGPL or GPL, including the changes, additions and wrapper. The rest of the application may be licensed as the developer wishes (rule).[2] Section 2 of the LGPL 2.1 sets the conditions for distributing a modified library (rule):[3]
- the modified work must itself be a software library;
- modified files must carry prominent notices of the change and its date;
- the whole modified work must be licensed at no charge to all third parties under the LGPL.
Linking applications with 7-Zip
The LGPL separates a “work that uses the Library” from the library itself. A program that contains no part of the library, but is designed to be compiled or linked with it, falls outside the licence when considered on its own. An executable that links it with the library is covered.[3] Section 6 lets such a combined work be distributed under terms the distributor chooses, if those terms permit modification for the customer’s own use and reverse engineering to debug those modifications. Each copy must also give prominent notice that the library is used and is covered by the LGPL, and must include a copy of the licence. The distributor must also do one of the things listed in §6(a) to §6(e). These include shipping the library source with the work, using a suitable shared-library mechanism, or giving a written offer valid for at least three years (rule).[3]
As commentary: loading an unmodified 7z.dll at run time, or calling the 7za.exe console program, keeps 7-Zip a separate library or program. The FAQ describes both approaches for adding 7z support to an application.[2]
unRAR restriction
The RAR decompression engine was developed using unRAR source code, which is copyright Alexander Roshal. That code may not be used to re-create the RAR compression algorithm, which is proprietary. Modified unRAR sources may be distributed, separately or inside other software, only if the documentation and source comments clearly state that the code may not be used to develop a RAR (WinRAR) compatible archiver (rule).[1] The source License.txt says that code under the LGPL with the unRAR restriction must follow both sets of rules.[4] The readme says the unRAR licence places almost no restrictions on compiled files, which may be linked to LGPL programs.[5]
The full unRAR licence in the source tree adds a condition. The unRAR utility may be freely distributed, but no person or company may charge a fee for distributing it without written permission from the copyright holder (rule).[6] SPDX lists an UnRAR licence under the identifier UnRAR. Its clause 2 is worded differently from the copy shipped with 7-Zip.[10][6]
Builds that must avoid this code can set DISABLE_RAR_COMPRESS=1. This removes the “not fully free” RAR decompression codecs, after which 7-Zip can still list RAR archives and extract files stored without compression. DISABLE_RAR=1 removes all RAR code (rule).[5]
BSD-licensed code
The LZFSE and ZSTD decompression code in 7z.dll is under the BSD 3-clause licence. The XXH64 code is under the BSD 2-clause licence.[1] Both licences require source redistributions to keep the copyright notice, conditions and disclaimer, and binary redistributions to reproduce them in the documentation or other materials. The 3-clause licence also bars using the names of the copyright holder or contributors to endorse derived products without written permission (rule; rule).[1] SPDX records these licences as BSD-3-Clause and BSD-2-Clause.[8][9]
Non-compliance
Any attempt to copy, modify, sublicense, link with or distribute the library in ways the LGPL does not allow is void. It automatically ends the rights of the party that made the attempt. Recipients who got copies from that party keep their licences as long as they remain compliant (rule).[3]
Out of scope
This page does not cover internal use, which is described in 7-Zip licensing. It also does not cover the public-domain LZMA SDK, which is described in 7-Zip LZMA SDK and bundled component licences, or LGPL versions later than 2.1, whose texts are not shipped with 7-Zip.