makeself 试用

makeself 是一个unix 自解压应用制作工具,100% shell,以下是一个简单的试用

下载makeself

因为基于shell,没有依赖,所以使用就比较简单了,clone 代码就可以了

git clone https://github.com/megastep/makeself.git

命令格式

makeself.sh [args] archive_dir file_name label startup_script [script_args]

关于参数说明的可以参考官方文档 <a href="https://makeself.io/">https://makeself.io/</a>

简单使用

  • 项目准备
    项目是一个简单的nodejs 项目,使用yarn 进行的包管理
    项目结构
 
├── index.js
├── package.json
├── post-install.sh
└── yarn.lock
  • 代码说明
    package.json 标准node 项目
 
{
  "name": "appdemo",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "scripts": {
    "start": "node index.js"
  },
  "dependencies": {
    "shortid": "^2.2.15"
  }
}

index.js 一个简单的console 输出

const shortid = require("shortid")
console.log(`shortid is ${shortid.generate()}`)

post-install.sh 自解压包启动命令(注意需要添加执行权限)

#!/bin/sh
yarn
rm -rf post-install.sh
  • 制作软件包
./makeself.sh --notemp ../appdemo node-app.run "node demo application" ./post-install.sh
  • 效果

 

 

  • 运行软件包

 

 


 

 

  • 释放软件包内容

 

 

说明

基于makeself 制作软件包还是一个不错的工具的,使用简单,方便,同时也有一个maven 的插件makeself-maven-plugin 对于java 应用的
打包还是很不错的

参考资料

https://github.com/hazendaz/makeself-maven-plugin
https://github.com/megastep/makeself
https://makeself.io/

posted on   荣锋亮  阅读(986)  评论(0编辑  收藏  举报

编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2017-01-26 好的产品经理,差的产品经理
2016-01-26 docker 镜像的保存以及导入
2016-01-26 docker 数据共享,数据复制
2016-01-26 docker nodejs 基本应用

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示