Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Use Makeself Create installation file     - Java in several ways of using MongoDB (Programming)

- Linux environmental performance data acquisition system (Linux)

- How linux network security configuration (Linux)

- Ubuntu install Avast antivirus software (Programming)

- Oracle Linux 5.9 configuration Xmanager (Linux)

- About phpwind 5.01-5.3 0day analysis of the article (Linux)

- Grading defense against Linux server attacks (Linux)

- NET Developers need to know some Linux commands (Linux)

- Docker commonly used commands Description (Linux)

- Ubuntu 14.04 installation configuration GNOME Classic interface (Linux)

- RedHat Linux 5.5 installation process SVN Service Notes (Server)

- How to use Xmanager Remote Desktop and VNC Log (Linux)

- Linux text processing tool of awk (Linux)

- RabbitMQ Getting Started Tutorial (Linux)

- Install Open vSwitch under CentOS 6.5 (Linux)

- PHP interview questions of design patterns (Programming)

- numpy and SciPy installation under Python for scientific computing package (Linux)

- Docker Basic Concepts (Linux)

- iptraf: A Practical TCP / UDP network monitoring tools (Linux)

- Let the terminal under Mac OS X as like Linux has displayed a variety of colors (Linux)

  Use Makeself Create installation file
  Add Date : 2018-11-21      
  Makeself.sh is a small Shell script that is used to generate a catalog from a self-extracting tar.gz archive. The results show a shell script file (as most in .run suffix), it can be run automatically. This document will extract itself to a temporary directory and an optional arbitrary command execution (for example: an installation script). It is very similar to Windows in the Winzip self-extracting files generated. Makeself It also includes verification and validation integrated child (CRC or MD5 checksum) is used.

Makeself.sh script itself is only used to create a document from a file directory. Generated documentation is actually a compressed (using gzip, bzip2, or compress) TAR file, at the beginning of the file to join a short Shell script. This is a small Stub script to execute unzip the file, run the embedded command and delete temporary files. To install the document contained in the software, the user only needs to run the "document", for example: sh nice-software.rum. I recommend these files using the "run" or "sh" as a suffix, do not confuse the user, because they know that it is actually a Shell script behind it with quite a bit of binary data.

2.1 From the beginning, makeself has been rewritten in the following test platform:

1. Linux (all distributions)

2. Sun Solaris (8 and above)

3. HP-UX (11.0 and 11i HPPA RISC on)

4. SCO OpenUnix and OpenServer

5. IBM AIX 5.1L

6 MacOS X (Dario)

7. SG IRIX 6.5

8. FreeBSD

9. UnicOS / Cray

10.Cygwin (Windows)

Home (current version 2.2.0):



Source Codes:


Download the latest official release:


Makeself installation

To install makeself on Linux, download the latest version of the archive format files, execute the downloaded file, since the file when extracting creates a new directory called makeself-2.2.0 in the current directory, copy all of the shell script to the / complete the installation under usr / bin directory.

$ Wgethttp: //megastep.org/makeself/makeself-2.2.0.run

$ Chmod 755 makeself-2.2.0.run

$ ./makeself-2.2.2.run

$ Cd makeself-2.2.0

$ Sudo cp * .sh / usr / bin


makeself.sh the basic use is as follows:

makeself.sh [args] archive_dir file_namelabel startup_script [script_args]

 "Label" parameter is the message SFX decompressed print, "start_script" and specify the script command after SFX archive unzipped successfully executed. When you want to create a self-extracting installation file will be useful. Typically startup script to copy and extract the contents to install the appropriate target directory. Startup script must be in the package directory, so the script is included in the SFX archive.

1. args is an optional parameter Makeself, usable are:

      --vesion: Print version information to the console, and then quit immediately;

- --gzip: Use GZIP compression (the default option)

- --bzip2: Compressed with bzip2

- --compress: Using the Unix compress command to compress data

- --nocomp: No compression

- --notemp: Do not extract the files to a temporary directory, but create a new subdirectory in the current directory.

- --current: Files will be extracted to the current directory rather than a subdirectory implied --notemp Options

- --follow: Follow all symbolic links, symbolic links to package those files.

- --append: Recent data to an existing document, instead of creating a new data.

- --header: Makeself2.0 start can use a separate header file storage stub, called makeelf-header.sh, located makeself assume the same position.

- --copy: ....

2. archive_dir: directory containing the name of the archive

3. file_name: Create archive file name

4. label: any text string description of the package, when extracting files show

5. startup_script: In order to extract the file directory, so if you want to execute a

Program in this directory, you must add the prefix "./", for example, before your command: ./ program is correct, script_args is an additional parameter change command.

Here is an example, assume that the user has a mirrored packet is stored in the / home / joe / mysoft directory that you want to generate a self-extracting mysoft.sh package, setup will start stored in the / home / joe / mysoft directory script, execute the following command:

makeself.sh/home/joe/mysoft mysoft.sh "Joe's Nice Software Package" ./setup

The following is to create a command contains Makeself release makeself.run document:

makeself.sh --notempmakeself makeself.run "Makeself by Stephane Peter" echo "Makeself has extracted itself"

Makeself by the generated document can pass the following parameters:

- --keep: Place extract the files to a temporary directory (embedded after the execution of the script will be deleted). Unzip the file directly into the current working directory until you delete it.

- --verbose: Before executing the embedded command prompts the user

- --target: Allows the extracted directory to any location

- --confirm: Before running the embedded command prompts the user to confirm

- --info: Print out the general information about the document (no decompression)

- --lsm: Print LSM entry

- --check: Using the embedded checksum verification documents, not extracting archive

- --nochown: Default, after decompression run "chown -R" command in the target directory, so that all the files belonging to the current user. If you run as root most need this, tar will attempt to re-create the initial user owner. You can disable this behavior.

- --tar: The content of the document run the tar command, use the latter as a parameter to the command parameters.

- --noexec: After decompression does not run the embedded script

Any arguments after the document as additional parameters passed to the embedded command. Before any of these options, you should use the display - specialized command-line structure to ensure Makeself does not try to explain them.

Create self-extracting archive

To create a self-extracting file that contains all the files in the backup directory, do the following operation. Start function simply prints "Extraction done" do more things.

$ Makeself.sh --notemp./backup ./backup.run "SFX archive for backup" echo "Extractiondone"

Header is 403 lines long


About to compress 1540 KB of data ...

Adding files to archive named "./ backup.run" ...






CRC: 2238411397

MD5: 0b0fd3a2ba08ffcec821b9cbaa11b70d


Self-extractible archive "./ backup.run" successfully created.

In order to extract the document file, simply perform document:

$ ./backup.run

Creating directory backup

Verifying archive integrity ... All good.

Uncompressing SFX archive forbackup .............


Create self-extracting installation file

  If you want to create a self-extracting installation file, you need to prepare a separate startup script, it will perform the installation process after the extraction is complete.

 1. Create a temporary directory

  #mkdir sftpupload

  2. Copy the file to the directory sftpupload-20141118.zip

 #cp < dir> /sftpupload-20141118.zip sftpupload

 3. Then create a script in sftpupload Shell installation directory, called install.sh:

 # Vi sftpupload / install.sh

#! / Bin / bash

echo "Upload start ..."


echo "1. Current directory $ CURRENT_DIR"

INSTALL_DIR = / data / natspace / nat / script / pyscript / sftpupload

TEMP_DIR = $ CURRENT_DIR / sftpupload

ZIP_FILE = sftpupload-20141118.zip

echo "2. Unzip file: $ ZIP_FILE to $ TEMP_DIR"

rm -rf $ TEMP_DIR

unzip $ ZIP_FILE -d $ TEMP_DIR


echo "3. Check the directory: $ INSTALL_DIR"

if [! -d $ INSTALL_DIR]; then

mkdir -p $ INSTALL_DIR


echo "4. Remove stop -. * shscript!"

rm -rf $ INSTALL_DIR / stop- *

echo "5. Move file to $ INSTALL_DIR"

mv -f * $ INSTALL_DIR

chmod 755 $ INSTALL_DIR / *. sh

echo "6. Delete the directory: $ CURRENT_DIR"


rm -rf $ CURRENT_DIR # TODO: makeself after execution of the script is finished remove the directory itself

echo "7. Execute stop-all.shscript"


echo "Update done!"

Then let the startup script has the executable:

$ Chmod 755 sftpupload / install.sh

Continue to create a self-extracting installation file, package startup script, as follows:

$ Makeself.sh sftpupload sftpupload.run "Update sftpupload program" ./install.sh

You must have a note :: install.sh (installation script) before "./" prefix, and install.sh script must have executable permission.

Note: install.sh (installation script) must be placed makeself package directory.
- C # using the HttpClient Note: Preheat the long connection (Programming)
- Use HttpClient remote interface testing (Programming)
- Denyhosts prevent hackers using SSH scanning (Linux)
- Linux file compression and archiving (Linux)
- Local port forwarding using iptables under linux (Server)
- How to upgrade Docker 1.6 on Fedora / CentOS (Server)
- Preview function to confirm the stop resource Oracle 12c new feature crsctl (Database)
- How to build Memcached Docker container (Server)
- Use Docker / LXC quickly launch a desktop system (Linux)
- To compile and install Redis Linux and master-slave replication configuration (Database)
- Python2.7.7 source code analysis (Programming)
- blecat: Bluetooth Gadgets (Linux)
- JBPM6 Tutorial - taught you how to install JBPM (Linux)
- MongoDB relations, references, index query coverage (Database)
- Ubuntu apt-mirror established local private sources (Linux)
- Ubuntu prevent arp attacks (Linux)
- Ubuntu users to install voice switch instructs the applet (Linux)
- 10 useful tools for Linux users (Linux)
- Ubuntu 13.04 configure MyEclipse 10.7 Environment (Linux)
- File upload via AngularJS and ASP.NET MVC5 (Programming)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.