diff --git a/.github/workflows/building-off-line-package.yml b/.github/workflows/building-off-line-package.yml index f586fe0..f107c7c 100644 --- a/.github/workflows/building-off-line-package.yml +++ b/.github/workflows/building-off-line-package.yml @@ -50,6 +50,8 @@ jobs: cp deep-wine-runner/off-line-shell/bwrap_amd64 package/bwrap -rv sudo chmod 777 -Rv package cd package + # 添加 Wine 运行器离线模式标识 + touch opt/apps/deepin-wine-runner/off-line.lock tar -cvf ../spark-deepin-wine-runner-off-line.tar * cd .. xz -T $cpu spark-deepin-wine-runner-off-line.tar diff --git a/mainwindow.py b/mainwindow.py index 128feea..c20c61b 100755 --- a/mainwindow.py +++ b/mainwindow.py @@ -1250,7 +1250,26 @@ class UpdateWindow(): os.makedirs("/tmp/spark-deepin-wine-runner/update") try: print(UpdateWindow.data["Url"]) - write_txt("/tmp/spark-deepin-wine-runner/update.sh", f"""#!/bin/bash + if os.path.exists(f"{programPath}/off-line.lock") or programPath != "/opt/apps/deepin-wine-runner": + # 使用解压法更新 + write_txt("/tmp/spark-deepin-wine-runner/update.sh", f"""#!/bin/bash +echo 删除多余的安装包 +rm -rfv /tmp/spark-deepin-wine-runner/update/* +echo 关闭“Wine 运行器” +python3 "{programPath}/updatekiller.py" +echo 下载安装包 +wget -P /tmp/spark-deepin-wine-runner/update {UpdateWindow.data["Url"][0]} +echo 安装安装包 +cd /tmp/spark-deepin-wine-runner/update +7z x *.deb +7z x data.tar +cp opt/apps/deepin-wine-runner "{programPath}" -rv +notify-send -i "{iconPath}" "更新完毕!" +zenity --info --text=\"更新完毕!\" --ellipsize +""") + else: + # 使用 deb 安装更新 + write_txt("/tmp/spark-deepin-wine-runner/update.sh", f"""#!/bin/bash echo 删除多余的安装包 rm -rfv /tmp/spark-deepin-wine-runner/update/* echo 关闭“Wine 运行器” @@ -2605,7 +2624,10 @@ Deepin 论坛:https://bbs.deepin.org gfdgd xi:https://gfdgd-xi.github.io

©2020~{time.strftime("%Y")} By gfdgd xi

''' -title = "Wine 运行器 {}".format(version) +if os.path.exists(f"{programPath}/off-line.lock"): + title = "Wine 运行器 {}(离线模式)".format(version) +else: + title = "Wine 运行器 {}".format(version) #

©2020~{time.strftime("%Y")} By gfdgd xi

''' updateThings = "{} 更新内容:\n{}\n更新时间:{}".format(version, updateThingsString, updateTime, time.strftime("%Y")) try: