Handle base64 encoding after compression. Updated documentation. Prepare for release 2.7.1.

This commit is contained in:
Stephane Peter
2025-12-10 02:03:33 -08:00
parent ce19ea1d2a
commit 3815292f73
6 changed files with 125 additions and 17 deletions
+5
View File
@@ -2,6 +2,11 @@
All notable changes to Makeself are documented here.
## 2.7.1
- Base64 encoding now runs after compression, consistent with other post-compression encryption/encoding options.
- Documentation updated to reflect that compression can be combined with encryption/encoding.
## 2.7.0
- Compression now precedes encryption so both can be enabled together.
+6 -6
View File
@@ -86,9 +86,9 @@ makeself.sh [args] archive_dir file_name label startup_script [script_args]
* **`--lz4`** : Use lz4 instead of gzip for better compression. The lz4 command must be available in the command path. It is recommended that the archive extension be set to something like '.lz4.run' for the archive, so that potential users know that they'll need lz4 to extract it.
* **`--zstd`** : Use zstd instead of gzip for better compression. The zstd command must be available in the command path. It is recommended that the archive extension be set to something like '.zstd.run' for the archive, so that potential users know that they'll need zstd to extract it.
* **`--pigz`** : Use pigz for compression.
* **`--base64`** : Encode the archive to ASCII in Base64 format instead of compressing (base64 command required).
* **`--gpg-encrypt`** : Encrypt the archive using `gpg -ac -z $COMPRESS_LEVEL`. This will prompt for a password to encrypt with. Assumes that potential users have `gpg` installed.
* **`--ssl-encrypt`** : Encrypt the archive using `openssl aes-256-cbc -a -salt`. This will prompt for a password to encrypt with. Assumes that the potential users have the OpenSSL tools installed.
* **`--base64`** : Base64-encode the final compressed archive (base64 command required). This is applied after compression and can be combined with any compressor.
* **`--gpg-encrypt`** : Encrypt the archive using `gpg -ac -z $COMPRESS_LEVEL`. This is applied after compression. Assumes that potential users have `gpg` installed.
* **`--ssl-encrypt`** : Encrypt the archive using `openssl aes-256-cbc -a -salt`. This is applied after compression. Assumes that the potential users have the OpenSSL tools installed.
* **`--compress`** : Use the UNIX `compress` command to compress the data. This should be the default on all platforms that don't have gzip available.
* **`--nocomp`** : Do not use any compression for the archive, which will then be an uncompressed TAR.
* **`--complevel`** : Specify the compression level for gzip, bzip2, pbzip2, zstd, xz, lzo or lz4. (defaults to 9)
@@ -189,13 +189,13 @@ I will gladly consider merging your pull requests on the [GitHub][10] repository
## Download
Get the latest official distribution [on Github here][9] (version 2.7.0).
Get the latest official distribution [on Github here][9] (version 2.7.1).
The latest development version can be grabbed from [GitHub][10]. Feel free to submit any patches there through the fork and pull request process.
## Changelog
The full release history has moved to `CHANGELOG.md`.
The full release history has moved to [`CHANGELOG.md`](https://makeself.io/changes).
## Links
@@ -224,7 +224,7 @@ This project is now hosted on GitHub. Feel free to submit patches and bug report
[6]: http://earth.google.com/
[7]: http://www.virtualbox.org/
[8]: http://www.gnu.org/copyleft/gpl.html
[9]: https://github.com/megastep/makeself/releases/download/release-2.7.0/makeself-2.7.0.run
[9]: https://github.com/megastep/makeself/releases/download/release-2.7.1/makeself-2.7.1.run
[10]: https://github.com/megastep/makeself
[11]: https://github.com/megastep/loki_setup/
[14]: http://bre.klaki.net/programs/setup.sh/
+1 -1
View File
@@ -1 +1 @@
2.7.0
2.7.1
+35 -2
View File
@@ -1,4 +1,4 @@
.TH "MAKESELF" "1" "2.7.0"
.TH "MAKESELF" "1" "2.7.1"
.SH "NAME"
makeself \- An utility to generate self-extractable archives.
.SH "SYNTAX"
@@ -54,14 +54,29 @@ Compress using pigz.
Compress using zstd.
.TP
.B --base64
Encode the archive to ASCII in Base64 format instead of compressing (base64 command required).
Base64-encode the final compressed archive (base64 command required). This runs after compression and can be combined with any compressor.
.TP
.B --gpg-encrypt
Encrypt the archive using GPG. This will prompt for a password to encrypt with.
.TP
.B --gpg-asymmetric-encrypt-sign
Asymmetrically encrypt and sign the archive using GPG.
.TP
.B --gpg-extra opt
Append more options to the gpg command line.
.TP
.B --ssl-encrypt
Encrypt the archive using OpenSSL. This will prompt for a password to encrypt with.
.TP
.B --ssl-passwd pass
Use the given password to encrypt the data using OpenSSL.
.TP
.B --ssl-pass-src src
Use the given src as the source of password to encrypt the data using OpenSSL.
.TP
.B --ssl-no-md
Do not use "-md" option (for older OpenSSL).
.TP
.B --keep-umask
Keep the umask set to shell default, rather than overriding when executing the self-extracting archive.
.TP
@@ -86,6 +101,9 @@ Specify the number of threads to be used by compressors that support paralleliza
.B --tar-extra opt
Append more options to the tar command line.
.TP
.B --untar-extra opt
Append more options when extracting the tar archive.
.TP
.B --notemp
The archive will create archive_dir in the current directory and
uncompress in ./archive_dir.
@@ -114,6 +132,9 @@ Specify a pre-extraction script.
.B --cleanup file
Specify a cleanup script that executes on interrupt and when finished successfully.
.TP
.B --cleanup-args args
Arguments to the cleanup script (wrap in quotes to provide multiple arguments).
.TP
.B --follow
Follow the symlinks in the archive.
.TP
@@ -129,6 +150,12 @@ Disable automatic spawn of an xterm if running in X11.
.B --nowait
Do not wait for user input after executing embedded program from an xterm.
.TP
.B --nochown
Do not give the target folder to the current user.
.TP
.B --chown
Give the target folder to the current user recursively.
.TP
.B --nomd5
Do not create a MD5 checksum for the archive.
.TP
@@ -146,6 +173,12 @@ Append a license file.
.TP
.B --packaging-date date
Use provided string as the packaging date instead of the current date.
.TP
.B --needroot
Require root permissions for extraction.
.TP
.B --export-conf
Export configuration variables to the startup script.
.SH "ENVIRONMENT"
.TP
.B SETUP_NOCHECK
+14 -8
View File
@@ -17,7 +17,7 @@
# Self-extracting archives created with this script are explictly NOT released under the term of the GPL
#
MS_VERSION=2.7.0
MS_VERSION=2.7.1
MS_COMMAND="$0"
MS_SIGN_NEXT=n
unset CDPATH
@@ -152,6 +152,7 @@ ENCRYPT=n
ENCRYPT_MODE=n
ENCRYPT_CMD=""
DECRYPT_CMD=""
BASE64_MODE=n
PASSWD=""
PASSWD_SRC=""
OPENSSL_NO_MD=n
@@ -237,8 +238,9 @@ do
shift
;;
--base64)
COMPRESS=base64
shift
ENCRYPT_MODE=base64
BASE64_MODE=y
shift
;;
--gpg-encrypt)
ENCRYPT_MODE=gpg
@@ -551,10 +553,6 @@ lz4)
GZIP_CMD="lz4 -c$COMPRESS_LEVEL"
GUNZIP_CMD="lz4 -d"
;;
base64)
GZIP_CMD="base64"
GUNZIP_CMD="base64 --decode -i -"
;;
compress)
GZIP_CMD="compress -fc"
GUNZIP_CMD="(type compress >/dev/null 2>&1 && compress -fcd || gzip -cd)"
@@ -597,6 +595,10 @@ gpg-asymmetric)
ENCRYPT_CMD="gpg $GPG_EXTRA -z$COMPRESS_LEVEL -es -o -"
DECRYPT_CMD="gpg $GPG_EXTRA --yes -d"
;;
base64)
ENCRYPT_CMD="base64"
DECRYPT_CMD="base64 --decode"
;;
n)
;;
esac
@@ -656,7 +658,11 @@ test -x "$TAR" || TAR=tar
tmparch="${TMPDIR:-/tmp}/mkself$$.tar"
(
if test "$APPEND" = "y"; then
tail -n "+$OLDSKIP" "$archname" | eval "$GUNZIP_CMD" > "$tmparch"
if test x"$ENCRYPT_MODE" != xn; then
tail -n "+$OLDSKIP" "$archname" | eval "$DECRYPT_CMD" | eval "$GUNZIP_CMD" > "$tmparch"
else
tail -n "+$OLDSKIP" "$archname" | eval "$GUNZIP_CMD" > "$tmparch"
fi
fi
cd "$archdir"
# "Determining if a directory is empty"
+64
View File
@@ -47,6 +47,14 @@ sslDiffInfo() {
diffInfo "$@"
}
base64DiffInfo() {
if ! command -v base64 >/dev/null 2>&1; then
# Skip gracefully if base64 is not available
return 0
fi
diffInfo "$@"
}
gpgDiffInfo() {
if ! command -v gpg >/dev/null 2>&1; then
# Skip gracefully if gpg is not available
@@ -285,6 +293,62 @@ EOF
assertEquals "$?" 0
)
testBase64WithGzipCompression() (
cd "$(mktemp -d)" || return 1
base64DiffInfo --packaging-date "@0" --base64 <<EOF
Identification: infotest
Target directory: infotest
Uncompressed size: ${UNCOMPRESSED_PLACEHOLDER}
Compression: gzip
Encryption: base64
Date of packaging: @0
Built with Makeself version ${VERSION}
Build command was: ./makeself.sh \\
"--packaging-date" \\
"@0" \\
"--base64" \\
"./infotest" \\
"./infotest.run" \\
"infotest" \\
"ls" \\
"-lah"
Script run after extraction:
ls -lah
infotest will be removed after extraction
EOF
assertEquals "$?" 0
)
testBase64WithZstdCompression() (
cd "$(mktemp -d)" || return 1
if ! command -v zstd >/dev/null 2>&1; then
return 0
fi
base64DiffInfo --packaging-date "@0" --base64 --zstd <<EOF
Identification: infotest
Target directory: infotest
Uncompressed size: ${UNCOMPRESSED_PLACEHOLDER}
Compression: zstd
Encryption: base64
Date of packaging: @0
Built with Makeself version ${VERSION}
Build command was: ./makeself.sh \\
"--packaging-date" \\
"@0" \\
"--base64" \\
"--zstd" \\
"./infotest" \\
"./infotest.run" \\
"infotest" \\
"ls" \\
"-lah"
Script run after extraction:
ls -lah
infotest will be removed after extraction
EOF
assertEquals "$?" 0
)
################################################################################
# Load and run shUnit2.