diff --git a/Makefile b/Makefile index ac2d3c1..5ca8560 100755 --- a/Makefile +++ b/Makefile @@ -109,6 +109,7 @@ package: cp -rv RemoveQemuUser.sh deb/opt/apps/deepin-wine-runner cp -rv InstallBox86.sh deb/opt/apps/deepin-wine-runner cp -rv InstallRuntime deb/opt/apps/deepin-wine-runner + python3 UpdateTime.py python3 RemovePycacheFile.py cp -rv deb /tmp/spark-deepin-wine-runner-builder mkdir -pv /tmp/spark-deepin-wine-runner-builder/usr/bin diff --git a/UpdateTime.py b/UpdateTime.py new file mode 100644 index 0000000..697a6a4 --- /dev/null +++ b/UpdateTime.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 +# 更新构建时间 +import os +import json +import platform +import datetime +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +with open(f"{programPath}/deb/opt/apps/deepin-wine-runner/information.json", "r") as file: + info = json.loads(file.read()) +info["Time"] = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") + " " + platform.platform() +with open(f"{programPath}/deb/opt/apps/deepin-wine-runner/information.json", "w") as file: + file.write(json.dumps(info, ensure_ascii=False, indent=4)) diff --git a/VM-source/mainwindow.cpp b/VM-source/mainwindow.cpp index 2db6254..08d54f4 100755 --- a/VM-source/mainwindow.cpp +++ b/VM-source/mainwindow.cpp @@ -68,6 +68,7 @@ MainWindow::MainWindow(QWidget *parent) : return; } QJsonObject versionObject = doc.object(); + QJsonValue buildTime = versionObject.value("Time"); QJsonValue versionValue = versionObject.value("Version"); QJsonArray thank = versionObject.value("Thank").toArray(); QString thankText = ""; @@ -79,7 +80,8 @@ MainWindow::MainWindow(QWidget *parent) : // 设置程序标题 this->setWindowTitle("Windows 应用适配工具 " + versionValue.toString()); // 读取谢明列表 - ui->textBrowser_2->setHtml("

程序版本号:" + versionValue.toString() + ", " + GetRunCommand("arch") + "

" + ui->textBrowser_2->toHtml() + + ui->textBrowser_2->setHtml("

程序版本号:" + versionValue.toString() + ", " + GetRunCommand("arch") + "

安装包构建时间:" + buildTime.toString() + "

该组件构建时间:" + + __DATE__ + " " + __TIME__ + "

" + ui->textBrowser_2->toHtml() + "

谢明列表

" + thankText); connect(ui->textBrowser_2, &QTextBrowser::anchorClicked, this, [=](const QUrl &link){ QDesktopServices::openUrl(link); diff --git a/information.json b/information.json index 920f2f4..612eea6 100644 --- a/information.json +++ b/information.json @@ -1,5 +1,6 @@ { "Version": "3.2.1", + "Time": "未知", "Thank": [ "感谢 RacoonGX 的付出与贡献", "感谢 @Amber 编写的《使用wine运行器打包无安装包的软件》:https://bbs.deepin.org/post/247720", diff --git a/mainwindow.py b/mainwindow.py index 2063144..435cd17 100755 --- a/mainwindow.py +++ b/mainwindow.py @@ -2444,6 +2444,7 @@ a:link, a:active {{ 版本:{version} 适用平台:{goodRunSystem}(@VersionForType@) +安装包构建时间:{information['Time']} Qt 版本:{QtCore.qVersion()} 程序官网:{programUrl} 当前程序占用体积:@programSize@MB