Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Use Makeself Create installation file     - OpenStack package problems and solutions under CentOS6 (Linux)

- Installing software on Ubuntu: apt-get and dpkg difference (Linux)

- Hadoop2.4.0 Eclipse plug-in making (Server)

- Virtual Judge structures under Ubuntu 14.04 (Server)

- Linux common network tools: batch scanning of hosting services netcat (Linux)

- The basic principle of pointers in C ++ (Programming)

- Mind mapping software installed in CentOS 7 in XMind (Linux)

- Under Linux using Magent + Memcached cache server cluster deployment (Server)

- Linux installed and tested the deployment of Kafka distributed cluster (Server)

- DBCA Error: ORA-19809: limit exceeded for recovery files process (Database)

- Detailed use Zabbix monitoring Nginx (Server)

- Java, extends and implements Usage (Programming)

- Docker installation under CentOS7 (Linux)

- Github Remote Assistance (Linux)

- Linux initialization init systems - Systemd (Linux)

- 14.04.3 Ubuntu configuration and successfully compiled source code Android 6.0 r1 (Programming)

- Use SecureCRT to transfer files between local and remote hosts (Linux)

- Echo Command Examples (Linux)

- 3 ways to create a lightweight, durable system of Ubuntu Linux USB disk (Linux)

- Install VLC player on Ubuntu 14.10 (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):

https://github.com/megastep/makeself

 http://megastep.org/makeself/

Source Codes:

https://github.com/megastep/makeself/archive/release-2.2.0.tar.gz

Download the latest official release:

http://cdn.megastep.org/makeself/makeself-2.2.0.run

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

Instructions

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" ...

./

./jpeg/

./jpeg/1.jpg

.

.

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 .............

Done

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 ..."

CURRENT_DIR = `pwd`

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

cd $ TEMP_DIR

echo "3. Check the directory: $ INSTALL_DIR"

if [! -d $ INSTALL_DIR]; then

mkdir -p $ INSTALL_DIR

fi

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"

cd $ INSTALL_DIR

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

echo "7. Execute stop-all.shscript"

./stop-all.sh

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.
     
         
         
         
  More:      
 
- To install the latest version of Shotwell 0.18 under Ubuntu (Linux)
- CentOS7 set boot directly into the command line interface (Linux)
- Oracle table Access Control (Database)
- Installation of Theano + CUDA under Ubuntu (Linux)
- Parameters of the extra port MySQL 5.6 (Database)
- Linux system security (Linux)
- How to install and use the malware detection tool LMD and ClamAV antivirus engine on Linux (Linux)
- To explore the caching mechanism for Android ListView (Programming)
- Ubuntu is not in the sudoers file problem solving (Linux)
- The three-way division of the sorting algorithm Quicksort (Programming)
- Android Studio quick overview of Gradle (Programming)
- Spring use Cache (Programming)
- PHP parsing algorithm of the interview questions (Programming)
- 10 really interesting Linux command (Linux)
- Rely on IP chain established Linux firewall (Linux)
- Let the router be your security barrier against external attack (Linux)
- Improve the efficiency of Linux development tools 5 (Linux)
- The SVN installation, configuration and start - up under Linux (CentOS 6.5) (Server)
- MySQL stored procedures execute dynamic sql statement (Database)
- Help you enhance Python programming languages 27 (Programming)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.