linux一键安装包制作,linux下使用makeself制作一键安装包

如何使用makeself制作一键安装包

1. 下载makeself

[root@mp tmp]# wget http://cdn.megastep.org/makeself/makeself-2.2.0.run

[root@mp tmp]# chmod +x makeself-2.2.0.run

[root@mp tmp]# ./makeself-2.2.0.run

2. 例子

- 目录

[root@mp tmp]# ls -R ms-sample/

ms-sample/:

installDetail.sh install.sh

- install.sh

[root@mp tmp]# cat install.sh

#!/bin/bash

echo "installing my software"

read -p "Press the ENTER key to continue." enterContinue

echo "************************************************************************"

echo " Installing Package..."

echo "************************************************************************"

. ./installDetail.sh

- installDetail.sh

[root@mp tmp]# cat installDetail.sh

#!/bin/bash

DIST_NAME=`lsb_release -ds 2>/dev/null || cat /etc/*release 2>/dev/null | head -n1`

echo "OS="$DIST_NAME

echo "here is installDetail"

3. 制作mstest.run

命令格式:./makeself.sh 要压缩的文件夹 生成的文件名 描述信息 第一个执行的脚本

[root@mp tmp]# ./makeself-2.4.0/makeself.sh ms-sample mstest.run "This is mstest installer" ./install.sh

Header is 587 lines long

About to compress 12 KB of data...

Adding files to archive named "mstest.run"...

./

./install.sh

./installDetail.sh

CRC: 3283785211

MD5: f45a2c7d3d6856c1cb6ff54f5db1fd49

Self-extractable archive "mstest.run" successfully created.

4. 运行测试

[root@mp tmp]# ./mstest.run

Verifying archive integrity... 100% All good.

Uncompressing This is mstest installer 100%

installing my software

Press the ENTER key to continue.

************************************************************************

Installing Package...

************************************************************************

OS=CentOS release 6.9 (Final)

here is installDetail

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值