PeaZip free archiver sources
archiver sources are released under GNU LGPL
v3 Open Source license, and are avilable as:
"Packages examples" peazip-x.y.z.pack.zip package is an optional
addition to source package,
as it is simply meant to help developers to create installer packages
for different package management systems, and to provides examples of
directory structures used to create DEB and RPM packages for the
- Git repository on GitHub
- standalone, downloadable ZIP package containing
PeaZip is written in FreePascal, a
powerful Open Source
cross-platform programming language highly
compatible with Delphi and ObjectPascal, and Lazarus IDE is
compile, build, and edit the source code.
Lazarus/FPC supports many more platforms
(architectures and Operating Systems) than the ones PeaZip is
built/tested for, following the "Write
once, compile anywhere" (WOCA)
While PeaZip sources contains ASM sections, a Pure Pascal alternative
implementation is always available to allow porting to new
Lazarus/FPC also supports multiple widgetsets (Win32/64, WinCE, GTK1,
Carbon, Cocoa, fpGUI) to allow compilation of GUI applications for the
supported systems (BSD, Darwin, Linux, macOS, Windows/ReactOS) and to
create different “flavours” of the application
for platforms supporting multiple widgetsets, e.g. Linux.
In PeaZip's sourcecode platform-specific, OS-specific, and
architecture-specific code sections are contained in conditional
Portable and installable packages shares the same code base, PeaZip is
natively an auto contained application as Lazarus tries to statically
link the binaries containing all the dependencies (or as much as
possible); only the packaging changes between the versions.
scripts (.iss files) are written using InnoSetup, which also uses a
Delphi-like syntax and are easily understandable for developers
proficient in Delphi or ObjectPascal dialects.
note that PeaZip provides strong cryptographic functions, so
please refer to cryptography laws and regulations that may apply in
start to compile PeaZip and build
a distributable package
Source package contains "dev"
subdirectory containing sources to compile the application's binaries,
containing resources needed by the application, and a readme.txt file containing
instructions to compile peazip and build a distributable package,
either as Portable application and for many different package
- Download and install Lazarus IDE for your
OS / architecture platform. In case of troubles installing
Lazarus, its forum is an
excellent starting point for obtaining support from a friendly
and competent community of developers using Lazarus / FreePascal.
- Add (peazip
Lazarus package to the project - otherwise it will be asked later
by the IDE, reporting missing package error, when trying to compile
peazip or pea binaries
- Compile sources in "dev" subdirectory, see below
"Notes for developers" section for
details about manual and automated compiling.
- Compiled binaries must be moved
up one level, into package's root folder (where readme.txt file is);
now dev subdir is no longer needed.
- Find appropriate builds of third party binaries for
the intended target OS and architecture, and copy them into
(peazip)/res/bin/ subfolders: please note that "res" folder provided in
source package (as
template for creating a working PeaZip port / distributable package)
contains only non- OS
/ architecture -dependant resources, so res/bin is simply a
not containing actual binaries but rather only the directories the
binaries need to be copied in.
- Zip the package to use / distribute it as a portable
- Read further suggestions below in "Notes for
developers" section to create an installable
package for your intended OS target
Quick suggestion about the Lazarus IDE
download and install FreePascal sources, FreePascal compiler, and
Lazarus IDE packages from the Lazarus
Lazarus currently uses GTK2 widget
set by default on Linux, but it is possible to target other widget
sets, in example:
It is also possible to install Lazarus from your distribution's
repository, and in some cases even non-GTK2 versions of Lazarus are
available, automatically handling the extra dependencies.
requires installation of Qt bindings
(currently in alpha stage) requires GTK development library, e.g. in
Ubuntu use sudo apt-get install libgtk-3-dev
On macOS, download and install
FreePascal sources, FreePascal
compiler, and Lazarus IDE packages from the Lazarus
You will also need to install Apple's Xcode, and to
separately install standalone Xcode
Command Line Tools, using the command:
sudo xcode-select --install
Note: after updating macOS to a new release it is likely you need to
also update Xcode and Xcode Command line Tools.
Lazarus currently uses Cocoa as
default widget set on macOS.
Binaries are compiled for x84_64
architecture by default, so they will run both on old Intel and newer
Apple Silicon (M1, M2...) Macs.
To change target architecture open main menu, Project >
Configuration and Target, set Darwin as
destination OS, and aarch64 as
destination CPU family.
Please note macOS will
for permission to run to (or to access some paths) the first time you
are running an unsigned binary.
Please refer to Lazarus' macOS
programming tips for
subjects as creation of universal
binaries, code signing
and notarization, and to
create a macOS application bundle
(in which PeaZip for macOS packages may be used as example).
Following table summarize the status of PeaZip project on different
operating systems, architectures, widget sets, and package management
systems: any help is deeply
appreciated to port PeaZip to new platforms!
|legacy, available from third party, see links in Linux
as portable and installable DEB and RPM packages, Flatpak available
from third party
compiles successfully, various graphic and fonts issues, Lazarus/FPC
support is marked as alpha for
as portable package, also available
from third party, see links on
Linux download pages
as portable package, alternatives are available from third party linked
on BSD download page
as installable DMG package, can also be used as portable app, run on
Intel and Apple Silicon machines
as installable DMG package, can also be used as portable app, run on
Apple Silicon machines only
as portable and installable EXE packages, recommended for legacy machines only
as portable and installable EXE and MSIX packages, not as store app
HOW TO COMPILE AND
BUILD PEAZIP APP BINARIES
LAZARUS IDE GUI
Open .lpi project files in Lazarus IDE and use main menu Run > Build
all to compile and build the binaries:
On Windows systems you will also need to compile (peazip
sources)/dev/dragdropfilesdll/dragdropfilesdll.lpi and copy
dragdropfilesdll.dll in the same directory of peazip.exe
- add /dev/metadarkstyle//metadarkstyle.lpk Lazarus
package to the project, otherwise the IDE will ask later, notifying the
- project_peach.lpi builds peazip, the main app
executable, file and archive manager
- project_pea.lpi builds pea, to manage pea archives, and to
provide file management, encryption
(AES, Serpent, Twofish),
and hashing / checksum
routines (Whirlpool, SHA / SHA2 / SHA3, BLAKE2, Ripemd160, MD5, various
AUTOMATICALLY, FROM COMMAND LINE OR SCRIPT
lazbuild string in following examples with the full qualified
path to lazbuild binary if needed - e.g. on Windows it is usually
Replace (peazip sources) with the full qualified path of PeaZip
- lazbuild --add-package (peazip
- lazbuild (peazip sources)/project_peach.lpi
- lazbuild (peazip sources)/project_pea.lpi
- lazbuild (peazip
sources)/dev/dragdropfilesdll/dragdropfilesdll.lpi //only needed for
COMPILE TIME OPTIONS
From main menu, Options > Settings, Advanced tab it is possible to
set PeaZip to NOT use non-free
software or archive formats.
This behavior can be hardcoded setting HLIBRE_DIR constant in peazip
(project_peach.lpi) at compile time:
0 not hardcoded, read from configuration;
1 hardcoded to allow only using known Free Software components
2 hardcoded to allow only using known Free Software components and
known open archive formats (not encumbered by patents for read nor
It is now possible to hardcode paths
of backend binaries, configuration, and resources at compile
time in order to met specific FHS or security requirements - e.g.
allowing paths only writeable with admin / root privileges.
Those paths are defined by HBINPATH, HCONFPATH, and
It is now possible to define at compile time a list of known SHA256 hash
values for known binaries invoked by PeaZip, in function
"checkhash" in peach.pas source file. This list can be checked on
demand to detect non-matching values, and in this case inform user that
some binaries are unknown.
HOW TO ASSEMBLE
PeaZip project packages follows this naming convention:
DEB packages are an exception to this rule, following Debian naming
"name" states the pakage (i.e. PeaZip, PeaZip Portable, sources...)
"version" field starts with version number x.y.z, then states target OS
(LINUX, WINDOWS, WIN64); on Linux systems is then declared the target
widgetset (i.e. GKT2, Qt5), and finally the release number (usually -1).
"architecture" on Linux declare target architecture (on Debian amd64 is
used in place of x86_64) and is omitted on Windows.
Portable should be built compressing a directory here referred
as (peazip), containing:
- pea and peazip binaries compiled for the target
system (and dragdropfilesdll.dll on Windows) in root directory of the
- (peazip)/res directory which contains resources
divided by type
- (peazip)/res/portable empty file marking the
package as portable
- (peazip)/res/bin directory containing architecture
dependent binaries, that should be compiled by respective third party
sources for the target system: refer to THIRD PARTIES section below, or
refer to the content of an existing package
- (peazip)/res/share directory containing
non-architecture dependent data such as texts, sample scripts, media,
documentation: refer to DETAILS ABOUT RES/SHARE section for further
- (peazip)/res/conf directory containing
configuration files, and user-created custom scripts, compression
settings, archive layouts
- For details on content of each res subpath plesase
refer to (peazip sources)/res, and possibly to an existing up to date
packages can be built starting from portable package:
pages for Linux, macOS, and Windows, can provide examples of
packages for a wide array of different installer technologies and for
many different package management systems, such as Windows EXE, MSI,
and MSIX installers, macOS DMG, Linux DEB, RPM, and flatpak - flatpak
packages are maintained by third parties developers at FlatHub.
- Remove (peazip)/res/portable file, in this way the
application will write configuration file to appropriate user specific
directory for the known systems, $XDG_CONFIG_HOME/peazip or
$HOME/.config/peazip for non_Windows systems following Open Deskptop
- Take care to place resources in proper paths
depending on the filesystem standards of the target system, e.g.
(peazip)/res/bin and (peazip)/res/share should be replaced to links to
pointing to (proper path)/peazip directory created in proper branches
of the filesystem for the type of resources.
- In example, in current Linux packages, (peazip) is
written to /usr/lib/peazip, with (peazip)/res/bin being
/usr/lib/peazip/res/bin directory, and (peazip)/res/share being a link
to /usr/share/peazip directory.
- This mechanism can be used, on systems not
supporting Open Desktop standards, also to redirect configuraton
folder, letting (peazip)/res/portable file, which tells the application
to write configuration to (peazip)/res/conf which will be, in this
case, replaced by a link.
- (required for Windows packages only), place
"Configure peazip.exe" compiled from InnoSetup script
peazip-setup_script_WIN*-configure.iss in (peazip)/res/bin directory
At its core, PeaZip is simply a standalone, as autocontained as
possible application (just as the Portable versions, which shares the
same code base) which is told to save the configuration in
system-specific user's path, and a set of scripts (mostly collected in
(peazip)/res/share/batch path, e.g. OpenDesktop .desktop files) which
instructs the host system on how to pass input and parameters to PeaZip.
"Packages examples" package peazip-x.y.z.pack.zip
provides examples of
the directory structures used to create DEB and RPM packages for the
current release, in order to help developers in assembling packages for
distribution with different package managers.
It is not needed to compile sources, it is only meant as additional
help to assemble packages.
(peazip)/res/share directory, containing non-architecture dependent
resources, can be used "as is" on all systems and types of packages.
If desired, system dependent resources can be omitted to reduce the
size of the package, i.e. in non-Windows packages it can be safely
removed sample .bat and .reg files, being of no use.
This directory should contain (or link to) peazip_help.pdf in its root
in order to provide offline help to users.
subfolder contains sample scripts to use
PeaZip from command line, .desktop files, SendTo examples for Windows,
and freedesktop_integration subpath which contains files for
integration in desktop environments compliant with freedesktop standars
(i.e. Gnome, KDE, and other common Linux DE)
(peazip)/res/share/copying contains copying.txt (the license file for
PeaZip project sources, released under LGPLv3) and third-parties
directory containing thir party licenses.
(peazip)/res/share/icons (required on Windows only) contains Windows
icons; .png icons for non-Windows systems are available in
(peazip)/res/share/lang path contains translations of application's
text, most of which are contributed by third parties translators
(peazip)/res/share/lang-wincontext (required on Windows only) path
contains .reg files to localize app's context menus in Windows
(peazip)/res/share/presets contains preset files for PeaZip defining
custom compression settings. Those files are editable, but user-defined
custom compression settings should be saved in configuration directory
consistently with PeaZip's behavior
(peazip)/res/share/readme files contains a minimal system-dependent
explanation about the application, for Windows and Linux users
(peazip)/res/share/themes path contains themes for PeaZip project;
themes are .7z files (with .theme suffix before .7z extension)
containing graphic resources and the theme file, an UTF-8 with BOM file
containing theming options
The units of crypto and math utilities library used in PeaZip are
derived from Wolfgang Ehrhardt's crypto library (originally
aes_2017-11-17.zip, crc_hash_2018-01-01.zip, fca_2017-11-17.zip,
serpent_2017-11-17.zip, tf_2017-11-17.zip, and util_2018-11-27.zip
libraries), released under Zlib license by Wolfgang Ehrhardt.
Libraries are kept up to date, in example were patched to allow build
on aarch64 architecture.
7z (LGPL), p7zip (LGPL), 7-Zip-zstd codecs (LGPL), Brotli (MIT
License), Zstandard (Dual license BSD / GPLv2), ARC (GPL),
ZPAQ/LPAQ/PAQ8* (GPL), QUAD (LGPL) / BALZ (public domain) / BCM (Apache
v2), strip and UPX (GPL) binaries are needed to support mainstream file
Those binaries are not included in source package (but are included in
the program's precompiled packages) and are intellectual property of
Up to date links to aforementioned projects are:
- https://www.7-zip.org/download.html 7-Zip's 7z
(Windows, Linux, and macOS), should be placed in (peazip)/res/bin/7z,
to manage 7Z files and most of
the other supported formats (including ISO, RAR, TAR, WIM, ZIP formats)
FreeArc, should be
placed in (peazip)/res/bin/arc to manage
compressor, should be placed in (peazip)/res/bin/brotli to manage Brotli compressed files
*PAQ, should be placed in
(peazip)/res/bin/lpaq, /paq, and /zpaq to work with PAQ files
- https://github.com/encode84/bcm, http://www.encode.su/, http://sourceforge.net/projects/bcm/
Muraviev's QUAD/BALZ/BCM, should be placed in (peazip)/res/bin/quad
only on Windows), should be placed in (peazip)/res/bin/upx
UPX, should be placed in
compressor, should be placed in (peazip)/res/bin/zstd to work with Zstandard
zamtmn's Lazarus package adding support for Windows 10+ dark mode
PeaZip can also support other binaries, which MUST NOT be included in
base packages due their closed source nature: official PeaZip packages
only contain software released under OSI-approved licenses.
- WinAce UnACE (royalty free), to work with ACE files, can be
back-end binary if placed in (peazip)/res/bin/unace, but must not be
included in packages because non-free license.
- RarLab UnRar (royalty free) can be supported as
back-end binary if placed in (peazip)/res/bin/unrar as alternative rar files extractor tool, but must not be
included in packages because non-free license.
- RarLab Rar.exe (shareware) can be supported as
back-end binary if installed on the same system (PeaZip can
auto-configure itself to use it to create
RAR archives), but must not
included in packages because it is non-free software AND has non
royalty free license.
Synopsis: Download page
of PeaZip sources (LGPLv3). Compile and build the application from
source code with Lazarus/FPC, help porting PeaZip to new Operating
and architectures, package PeaZip binaries for more installers types
and package managers systems. How to assemble Portable version and
Topics: PeaZip source
packages, code base Git repository, how to create portable or
installable packages for PeaZip
PeaZip > Downloads
> Compile and buid PeaZip from sources