All Articles

Make Self-Extractable Archives on Unix

makeself

The makeself.sh is a small shell script that generates a self-extractable compressed tar archive from a directory. The resulting file appears as a shell script (usually has a .run suffix), and can be launched as is. The archive will then uncompress itself to a temporary directory, and an optional arbitrary command will be executed (for example, an installation script). This is pretty similar to archives generated with WinZip Self-Extractor in the Windows world. Makeself archives also include checksums for integrity self-validation (CRC and/or MD5/SHA256 checksums). Many popular Linux applications are distributed as makeself self-extracting archives, like the Nvidia Linux drivers, the Google Earth Linux installer, etc.

The makeself.sh has been rewritten and tested on the following platforms:

  • Linux (all distributions)
  • Sun Solaris (8 and above)
  • HP-UX (tested on 11.0 and 11i on HPPA RISC)
  • SCO OpenUnix and OpenServer
  • IBM AIX
  • macOS (Darwin)
  • SGI IRIX 6.5
  • FreeBSD
  • OpenBSD
  • NetBSD
  • UnicOS / Cray
  • Windows (Cygwin, WSL)

The generic usage of makeself.sh is as follows:

$ makeself.sh [args] archive_dir file_name label startup_script [script_args]

We could find more details about the arguments in the official documentation.

Published Dec 9, 2019

Flying code monkey