qt程序打包安装包
2018-04-12 14:09
316 查看
Qt installer framework
下载framework,安装(/Qt/QtIFW-3.0.2/examples目录下有很多实例)官网使用说明
使用framework(以examples中的tutorial为例)
1. 创建安装包目录树
tutorial ├── config │ └── config.xml └── packages └── com.vendor.product ├── data │ └── installcontent.txt └── meta ├── installscript.qs ├── license.txt ├── package.xml └── page.ui
2. 创建配置文件
(即/tutorial/config/config.xml)<?xml version="1.0" encoding="UTF-8"?> <Installer> <Name>Your application</Name> <Version>1.0.0</Version> <Title>Your application Installer</Title> <Publisher>Your vendor</Publisher> <StartMenuDir>Super App</StartMenuDir> <!--windows开始菜单中的分组--> <TargetDir>@HomeDir@/InstallationDirectory</TargetDir> <!--默认安装位置--> </Installer>
主要是修改
[1] -- <Titile> [2] -- <Name>
3. 创建安装包信息文件
(即/tutorial/packages/com.vendor.product/meta/package.xml)<?xml version="1.0" encoding="UTF-8"?> <Package> <DisplayName>The root component</DisplayName> <Description>Install this example.</Description> <Version>0.1.0-1</Version> <ReleaseDate>2010-09-21</ReleaseDate> <Licenses> <License name="Beer Public License Agreement" file="license.txt" /> </Licenses> <Default>script</Default> <Script>installscript.qs</Script> <!--installscript.qs脚本定制安装过程--> <UserInterfaces> <UserInterface>page.ui</UserInterface> <!--界面资源文件--> </UserInterfaces> </Package>
主要修改
[1] -- <DisplayName> [2] -- <Description>
[1] – 具体的文件描述在
/tutorial/packages/com.vendor.product/meta/license.txt中
/tutorial/packages/com.vendor.product/meta/package.xmlinstallscript.qs示例
function Component() { // constructor component.loaded.connect(this, Component.prototype.loaded); if (!installer.addWizardPage(component, "Page", QInstaller.TargetDirectory)) console.log("Could not add the dynamic page."); } Component.prototype.isDefault = function() { // select the component by default return true; } Component.prototype.createOperations = function() { try { // call the base create operations function component.createOperations(); } catch (e) { console.log(e); } } Component.prototype.loaded = function () { var page = gui.pageByObjectName("DynamicPage"); if (page != null) { console.log("Connecting the dynamic page entered signal."); page.entered.connect(Component.prototype.dynamicPageEntered); } } Component.prototype.dynamicPageEntered = function () { var pageWidget = gui.pageWidgetByObjectName("DynamicPage"); if (pageWidget != null) { console.log("Setting the widgets label text.") pageWidget.m_pageLabel.text = "This is a dynamically created page."; } }
4. 创建安装内容
(即/tutorial/packages/com.vendor.product/data/installcontent.txt)实际要打包的程序文件(.dll, .exe等)存放于该目录(data)下
5. 创建可执行文件
(当前目录在tutorial下)../../bin/binarycreator -c config/config.xml -p packages YourInstaller
6. 实际操作
将要打包的工程使用 release 模式编译使用ldd命令查找相关依赖,将依赖文件也置于同一文件下
将release下的依赖文件以及可执行程序文件拷贝到data目录下
使用binarycreator命令行直接生成安装包
参考链接
相关文章推荐
- windows下打包QT程序成安装包
- windows下打包QT程序成安装包2
- 【打包成exe安装包文件发布你的程序】使用QT联系人管理系统的例子
- Linux下打包QT程序成安装包
- 02-QT5程序打包成可执行文件.exe和安装包.setup
- Mac下将QT程序打包成能发布到Mac App store的pkg安装包
- 如何使用visual studio将你的程序打包成安装包
- Qt Qt Quick QML 打包发布程序出现缺少dll,窗体空白,点击后无反应等发布不成功的终极解决方法
- Qt程序打包发布方法(使用官方提供的windeployqt工具)
- win7平台下QT软件的打包与发布 (利用NSIS脚本制作安装包)
- 【笔记】Qt程序在Windows、OS X、CentOS、Ubuntu下的打包处理
- Qt程序打包、发布——使用官方windeployqt
- s3c2410上搭建QT/Embedded4.8.5开发环境(五)--程序安装后的打包,以及环境变量的设置
- Windows下Qt程序的打包
- Qt 程序打包发布总结
- windows下打包QT5.1程序
- Inno Setup 编译器 打包安装包程序模板源码例子
- 怎样将程序猿写出来的程序打包成安装包(最简单的)
- 使用QT自带工具进行程序打包
- qt程序打包成单一文件EXE (一)