代码拉取完成,页面将自动刷新
autoUpgrader是基于QT的通用桌面程序自动升级更新解决方案。
5.15.X
Qt Creator
后端接口配置为json格式文件,这里保存的文件名为autoUpgrader.json,可自定义。
{
"version": 101,
"versionStr": "1.0.1",
"type": 1,
"zipurl": "http://192.168.1.5/autoupdate/dist.zip",
"mainAppName":"客户端.exe",
"filelist": [
{
"path": "/",
"sublist": [
"http://192.168.1.5/autoupdate/dist/opengl32sw-01.dll",
"http://192.168.1.5/autoupdate/dist/客户端.exe"
]
},
{
"path": "html",
"sublist": [
"http://192.168.1.5/autoupdate/dist/html/error.html",
"http://192.168.1.5/autoupdate/dist/html/index.html"
]
}
]
}
其中:
压缩包内容示例(dist是待压缩的目录):
dist
├── html
│ ├── error.html
│ └── index.html
├── 客户端.exe
└── opengl32sw-01.dll
QString configFilePath = QDir::currentPath()+"/version.dat";
configFilePath = QDir::toNativeSeparators(configFilePath);
QFile writeFile(configFilePath);
writeFile.open(QIODevice::WriteOnly);
QDataStream out(&writeFile);
out << 101;
writeFile.close();
[upgrade]
url=http://192.168.1.5/autoupdate/autoUpgrader.json
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。