How to install and use Makeself

  
on Linux

Makeself is just a script under Linux, can be used for file creation, because makeself has been rewritten, so many people do not know how to use makeself, the following small series will introduce you The Linux installation uses the method of makeself.

Makeself.sh is a small Shell scripts for generating a self-extracting compressed tar.gz from a catalog. The resulting file is displayed as a shell script (mostly with a .run extension) and can be run automatically. The document extracts itself to a temporary directory and executes an optional arbitrary command (for example: an installation script). It is very similar to the Winzip self-extracting file generated in Windows. The Makeself document also includes a checksum for integration sub-verification (CRC or MD5 checksum).

The Makeself.sh script itself is only used to create a document from a file directory. The generated document is actually a compressed (using gzip, bzip2 or compressed) TAR file, with a short shell script added at the beginning of the file. This is a small Stub script for executing unzipped files, running embedded commands, and deleting temporary files. In order to install the software included in this document, the user only needs to run “documents”, for example: sh nice-software.rum. I recommend using these files as "run” or "sh” as suffixes, don't confuse users, because they know that it's actually a shell script with a lot of binary data behind it.

Starting with 2.1, makeself has been rewritten and tested on the following platforms:

1. Linux (all distributions)

2. Sun Solaris (8 The above version)

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

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)

Makeself installation

In order to install makeself on Linux, download the latest version of the archive format file, execute the downloaded file, and create a new one in the current directory when the file is self-extracting. The directory is called makeself-2.2.0, copy all the shell scripts to the /usr/bin directory to complete the installation.

$ 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

How to use

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

“label” parameters are messages printed when SFX is decompressed, “ Start_script” specifies the scripts and commands that are executed after the SFX archive has been successfully unzipped. Useful when you want to create a self-extracting installation file. Usually the startup script will copy and install the extracted content to the appropriate target directory. The startup script must be in a packaged directory, so the script is included in the SFX archive.

1. args is an optional parameter of Makeself, available:

--vesion: print version information to the console, then exit immediately;

- -- Gzip: use GZIP compression (default option)

- --bzip2: compress using bzip2

- --compress: compress data using Unix's compress command

- - -nocomp: not compressed

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

- --current: The file will be extracted to the current directory, not in a subdirectory, implied --notemp option

- --follow: follow all symbolic links, also package those Symbol linked file.

- --append: The most recent data is in an existing document instead of creating a new one.

- --header: Makeself 2.0 can start with a separate file to store the header stub, called makeelf-header.sh, assuming it is in the same location as makeself.

- --copy:….

2. archive_dir: directory name containing the archive file

3. file_name: name of the created archive file

4. label: any text string describing the package, Display when extracting files

5. startup_script: Extract the commands in the file directory, so if you want to execute a

program in that directory, you must add it before your command. Prefix on “. /”, for example: /program is correct, script_args is an additional parameter to the command.

Here is an example. Suppose the user has a package image stored in the /home/joe/mysoft directory. It wants to generate a self-extracting mysoft.sh package that will be started and stored in /home/joe. The setup script in the /mysoft directory, execute the command as follows:

makeself.sh/home/joe/mysoft mysoft.sh “Joe‘s Nice Software Package” /setup

Here is the command to create a makeself.run file containing the Makeself distribution:

makeself.sh --notempmakeself makeself.run “Makeself by Stephane Peter” echo“Makeself has extracted It&#>

Documents generated by makeself can pass the following parameters:

- --keep: The drop file is extracted into a temporary directory (will be deleted after the embedded script is executed). The file will be extracted directly into the current working directory until you delete it.

- --verbose: Prompt user before executing embedded commands

- --target: Allow decompression of directories to any location

- --confirm: Run embedded Prompt user to confirm before command

- --info: Print out general information about the document (not decompressed)

- --lsm: Print LSM entry

- -- Check: check the document with the embedded checksum, do not extract the document

- --nochown: By default, run the “chown -R” command in the target directory after decompression so that all files belong to the current user . If you need to run most of the root user, tar will try to recreate the initialized user owner. You can disable this behavior.

- --tar: Run the tar command on the contents of the document, using the following parameters as arguments to the command.

- --noexec: Do not run embedded scripts after decompression

Any parameters following the document will be passed as additional parameters to the embedded command. Before any of these options, you should show the use of a dedicated command line structure to ensure that Makeself does not attempt to interpret them.

The above is a Linux installation using makeself method. Note that the file created with makeself is a compressed TAR file, which is extracted with a shell script.

Copyright © Windows knowledge All Rights Reserved