From f63cdff0aac7a0f9dde99dc103a0a934f40b9297 Mon Sep 17 00:00:00 2001
From: gfdgd_xi <3025613752@qq.com>
Date: Tue, 11 Jul 2023 15:08:28 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BF=90=E8=A1=8C=E5=BA=93?=
=?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=96=B9=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
WineLib/run.sh | 10 +++++++---
mainwindow.py | 15 +++++++--------
2 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/WineLib/run.sh b/WineLib/run.sh
index 2400f79..9c1b0b9 100755
--- a/WineLib/run.sh
+++ b/WineLib/run.sh
@@ -1,12 +1,16 @@
#!/bin/bash
CURRENT_DIR=$(cd $(dirname $0); pwd)
+if [[ ! -d "$CURRENT_DIR/usr" ]]; then
+ zenity --info --text=未安装运行库,无法运行 --no-wrap
+ exit
+fi
if [[ ! -d /lib64 ]]; then
pkexec mkdir /lib64 -p
fi
bwrap --dev-bind / / \
- --ro-bind $CURRENT_DIR/lib /lib \
- --ro-bind $CURRENT_DIR/lib64 /lib \
- --ro-bind $CURRENT_DIR/usr /usr \
+ --ro-bind "$CURRENT_DIR/lib" /lib \
+ --ro-bind "$CURRENT_DIR/lib64" /lib \
+ --ro-bind "$CURRENT_DIR/usr" /usr \
--ro-bind /usr/share /usr/share \
--ro-bind /usr/bin /usr/bin \
--ro-bind /usr/sbin /usr/sbin \
diff --git a/mainwindow.py b/mainwindow.py
index d9765dc..6853edc 100755
--- a/mainwindow.py
+++ b/mainwindow.py
@@ -2358,13 +2358,6 @@ def CheckWine():
"/opt/exagear/bin/ubt_x32a64_al -- "
]
)
- if os.path.exists(f"{programPath}/WineLib/usr/lib/ld-linux-x86-64.so.2"):
- nameValue.append(
- [
- "使用运行器的运行库运行",
- f"bash '{programPath}/WineLib/run.sh' "
- ]
- )
for g in qemuBottleList:
nameValue.append([
f"使用qemu-{g[0]}-static 调用容器{g[1]}运行 ",
@@ -2398,6 +2391,11 @@ def CheckWine():
wine[f"{k[0]}{chrootProgramPath}/wine/{i}/bin/wine-x86_64"] = f"{k[1]}{chrootProgramPath}/wine/{i}/bin/wine-x86_64"
canUseWine.append(f"{k[0]}{chrootProgramPath}/wine/{i}/bin/wine-x86_64")
untipsWine.append(f"{k[0]}{chrootProgramPath}/wine/{i}/bin/wine-x86_64")
+ for i in canUseWine[:]:
+ if not os.path.exists(f"{programPath}/WineLib/usr/lib/ld-linux-x86-64.so.2"):
+ wine[f"使用运行器的运行库运行 {i}"] = f"bash '{programPath}/WineLib/run.sh' {wine[i]}"
+ canUseWine.append(f"使用运行器的运行库运行 {i}")
+ untipsWine.append(f"使用运行器的运行库运行 {i}")
except:
pass
try:
@@ -2676,7 +2674,8 @@ mainLayout.setColumnStretch(1, 1)
mainLayout.addWidget(returnText, 0, 1, 2, 1)
# 版权
-copy = QtWidgets.QLabel(f"""\n程序版本:{version},提示:Wine 无法保证可以运行所有的 Windows 程序,如果想要运行更多 Windows 程序,可以考虑虚拟机和双系统
+copy = QtWidgets.QLabel(f"""程序版本:{version},提示:Wine 无法保证可以运行所有的 Windows 程序,如果想要运行更多 Windows 程序,可以考虑虚拟机和双系统
+注:部分二进制兼容层会自动添加 binfmt-support(如原版的 Box86/64、Qemu User Static),则无需在 Wine 版本那里特别指定兼容层,直接指定 Wine 即可
©2020~{time.strftime("%Y")} gfdgd xi""")
mainLayout.addWidget(copy, 2, 0, 1, 1)