GOG uses installers generated by mojosetup-package, which are popular for distributing DRM free proprietary games on Linux. They come as a shell script with a huge chunk of binary data appended. The basic structure is script, installer and game data at the end. These are the steps that happen before the setup window pops up:
Shell runs the Makeself code at the start of the package
Makeself sets $MAKESELF_SHAR to the package location.
Makeself reads a hardcoded number of lines and counts the bytes to determine its own size and therefore the installer archive offset.
Makeself unpacks the installer archive to a temporary location using dd, gzip and tar.
Makeself runs the installer start script, which assigns $MAKESELF_SHAR to $MOJOSETUP_BASE and runs the MojoSetup binary.
MojoSetup opens the package by searching for known magic numbers in the file. This is a different archive in zip format added after the one for the installer.
MojoSetup does the installation by copying the files from /data and running the scripts in /scripts.