From baf3fbefddfda8eae84e6551f029ef81afe41840 Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Sun, 9 Apr 2023 18:49:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AE=89=E8=A3=85=E5=8C=85?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 1 + UpdateTime.py | 12 ++++++++++++ VM-source/mainwindow.cpp | 4 +++- information.json | 1 + mainwindow.py | 1 + 5 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 UpdateTime.py 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() + "