Freedom Environment

'Self-Extracting Install Files'

Code Samples
of the pairs of

(FE = Freedom Environment)

Top of an extract-from-self
FE system install script.

This script is being shown
in the FE 'xpg' text file
browser utility.

FE Home page > FE Downloads page >

FE 'Self-Extracting Install Files'

! Note !
These shell-script code samples may be
updated over time --- if they are changed
significantly when new FE sub-systems are released.


In the summer of 2010, when I first started releasing the FE sub-systems --- 'feNautilusScripts', 'xpg', and 'feAppMenus' first --- I released each sub-system using a pair of scripts to build a 'self-extracting install file' for each FE sub-system.

The first script in each pair of build-scripts is used to build a 'gzipped tar file' containing the sub-directories and files of the sub-system.

Note that this gzipped-tar-file is a 'binary file', not a 'text file' --- due to the file compression that is performed by the 'gzip' command.

The second script in each pair of build-scripts is used to hold the shell-script code that is to be concatenated at 'the front' of the 'gzipped tar file'.

The purpose of that shell-script code is to read that concatenated file (the 'self-extracting install file') and

  • extract the 'gzipped tar file' from the 'back end' of the concatenated file, by using the 'tail' command

    (The extracted '.tgz' file is put in the '/tmp' temporary files directory.)

  • the tar-file compression is undone with a 'gunzip' command, yielding the 'tar file' containing the sub-directories and files of the FE sub-system

  • the tar file is 'un-tarred' using a 'tar -xvf' command to place the sub-directories and files into a target directory:

    • $HOME/apps/tkGooies for the FE 'tkGooies' sub-system

    • $HOME/apps/feAppMenus for the 'feAppMenus' sub-system

    • $HOME/apps/feXpg for the FE 'xpg' sub-system

    • $HOME/.gnome2/nautilus-scripts for the 'feNautilusScripts' sub-system

      The contents of the 'nautilus-scripts' directory can be moved or copied to the


      directory to use the 'feNautilusScripts' in a MATE-Caja environment instead of a Gnome2-Nautilus environment.

      The contents of the 'nautilus-scripts' directory can be moved or copied to the


      directory to use the 'feNautilusScripts' in a Gnome3-Files environment, instead of a Gnome2-Nautilus environment.

      (Warning: The Gnome3 project is dumbing down the file-manager and many other aspects of the project.

      The 'nautilus scripts' capability may be going away from Gnome3 in the 2018 to 2020 time frame.)

The 'pairs of build scripts'
for each 'self-extracting install file':

Below is the code for the pairs of 'build-scripts', for each of four main FE sub-systems:

  • 'feNautilusScripts'
  • FE 'tkGooies'
  • FE 'xpg'
  • 'feAppMenus'

Copious comments in these scripts explain their inner workings.

Each pair of build-scripts is used to build a 'self-extracting install file' --- which is composed of 'self-extracting shell script code' that is concatenated 'ahead of' a gzipped-tar-file, which contains the sub-directories and files of the application sub-system.

Note that during an FE install, the 'self-extracting install file' reads itself and extracts out the gzipped-tar-file (by using a 'tail' command), and then uses that extracted file to complete the installation, by using 'gunzip' and 'tar -x' commands.

Note that a requirement of the installer's operating system is that it have 'industry standard' commands like 'tail' and 'gunzip' and 'tar' available to its shell interpreter environment.

You can 'right-click' on each link below, and, in the popup menu that your web browser presents, you can use an option such as 'Save Link Target As ...' to save the script code to a file on your local machine.

Or simply click on each link to see the code for each script, in a separate window or tab.

For the FE 'tkGooies' sub-system:


02_extractFromSelf_code_ forCat2tarfile_ ofTkGooiesDirs_

For the FE 'NautilusScripts' (or 'CajaScripts') sub-system:


02_extractFromSelf_code_forCat2tarfile_ ofNautScrDirs_

For the FE 'AppMenus' sub-system:


02_extractFromSelf_code_ forCat2tarfile_ ofAppMenusDirs_

For the FE 'xpg' sub-system:


02_extractFromSelf_code_ forCat2tarfile_ ofXpgDirs_

Post-Script :
(parting comments)

I have put a date in the names of these scripts to indicate the last time they were updated.

The 'tkGooies' and 'feNautilusScripts' build-scripts were used most recently and are the most up-to-date.

The 'feAppMenus' and 'xpg' build-scripts need to be updated with the 'grep'-code that automatically detects the line number of the last line of the 'self-extracting script code' (an 'exit' statement) --- and then uses that line number in the 'tail' command that extracts the gzipped-tar-file from the concatenated file that consists of the self-extracting script code followed by the binary gzipped-tar-file.

I will update those 'feAppMenus' and 'xpg' build-scripts, the next time I do a release of the 'feAppMenus' and 'xpg' sub-systems.

You are welcome to use these pairs of build-scripts as models for building your own 'self-extracting install files' for your own releases of Linux/Unix/MacOS applications.

Bottom of this
FE Self-Extracting Install Files -
Code Samples of Build-Scripts

To return to a previously visited web page, click on the Back button of your web browser a sufficient number of times. OR, use the History-list option of your web browser.
OR ...

< Go to Table of Contents, above. >

< Go to Top of Page, above. >

Page history:

Page was created 2015 May 02.

Page was changed 2018 Aug 12.
(Added css and javascript to try to handle text-size for smartphones, esp. in portrait orientation.)

Page was changed 2019 Jul 15.
(Specified an image width in percents to size the image according to width of the browser window. Some minor reformatting of paragraphs.)