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>
例子: