qt打包程序方法(非常好用)

1.下载

Index of /official_releases/qt-installer-framework/4.6.1

binarycreator --offline-only -c config/config.xml -p packages install.exe -v
@echo off
start cmd /k "binarycreator --offline-only -c config/config.xml -p packages install.exe -v"


<?xml version="1.0" encoding="UTF-8"?>
<Installer>
    <Name>软件名称</Name><!-- 软件名称 -->
    <Version>0.1.3</Version><!-- 版本号 -->
    <Title>安装程序窗口标题</Title><!-- 安装程序窗口标题 -->
    <Publisher>公司名称</Publisher><!-- 公司名称 -->
    <!-- Directory name is used in component.xml -->
    <StartMenuDir>Ancel IR</StartMenuDir><!-- 要生成的windows开始菜单目录 -->
    <TargetDir>@HomeDir@/APPPath</TargetDir><!-- 默认安装路径 -->
    <Logo>logo.png</Logo>
    <InstallerApplicationIcon>app</InstallerApplicationIcon><!-- app.ico,但是不要ico后缀 -->
    <InstallerWindowIcon>app.png</InstallerWindowIcon>
</Installer>
<?xml version="1.0" encoding="UTF-8"?>
<Package>
    <DisplayName>主程序</DisplayName>
    <Description>主程序描述.</Description>
    <Version>1.0.0-1</Version>
    <ReleaseDate>2013-01-01</ReleaseDate>
    <Default>true</Default>
    <Script>installscript.qs</Script>
</Package>

function Component()
{
    // default constructor
}

Component.prototype.createOperations = function()
{
    component.createOperations();

    //开始菜单的快捷方式
    component.addOperation
    (
        "CreateShortcut",
        "@TargetDir@\\debug.exe",
        "@StartMenuDir@\\debug.lnk",
        "workingDirectory=@TargetDir@",
        "description=Open Application"
    );

    //桌面快捷方式
    component.addOperation
    (
        "CreateShortcut",
        "@TargetDir@\\debug.exe",
        "@DesktopDir@\\debug.lnk",
        "workingDirectory=@TargetDir@",
        "description=Open Application"
    );
}

 

function Component()
{
    // default constructor
}

Component.prototype.createOperations = function()
{
    component.createOperations();
    if (systemInfo.productType === "windows")
    {
        component.addElevatedOperation("Execute", "{0,1,256}", "@TargetDir@\\CH341SER_2.EXE");
        component.addElevatedOperation("Delete", "@TargetDir@\\CH341SER_2.EXE");
    }

}
<?xml version="1.0" encoding="UTF-8"?>
<Package>
    <DisplayName>CH340驱动</DisplayName>
    <Description>CH340驱动描述</Description>
    <Version>1.0.0-1</Version>
    <ReleaseDate>2013-01-01</ReleaseDate>
    <Default>true</Default>
    <Script>installscript.qs</Script>
    <RequiresAdminRights>true</RequiresAdminRights> <!-- 代表用管理员权限安装这个组件 -->
</Package>

 

 

例子: 

参照:Qt 把.exe打包成安装文件形式_qt程序打包成安装包-CSDN博客

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值