From 9fd8f5144f7545b2e511e99ffc6854cbb4309ed3 Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Tue, 11 Jul 2023 22:32:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B0=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WineLib/run.sh | 26 ++++++++++++++------------ mainwindow.py | 3 ++- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/WineLib/run.sh b/WineLib/run.sh index 4de1ebb..a461e6e 100755 --- a/WineLib/run.sh +++ b/WineLib/run.sh @@ -28,26 +28,28 @@ do fi fi done -if [[ -L /usr/lib64 ]] && [[ ! -d "$CURRENT_DIR/usr/lib64" ]]; then +if [[ -d /usr/lib64 ]] && [[ ! -d "$CURRENT_DIR/usr/lib64" ]]; then mkdir -p "$CURRENT_DIR/usr/lib64" fi -for libr in `ls /usr/lib64/ld*.so*` -do - if [[ -f $libr ]]; then - if [[ ! -f "$CURRENT_DIR/$libr" ]]; then - systemNeedCommand="$systemNeedCommand --ro-bind $libr $libr " - touch "$CURRENT_DIR/$libr" - else - if [[ ! -s "$CURRENT_DIR/$libr" ]]; then +if [[ -d /usr/lib64/ ]]; then + for libr in `ls /usr/lib64/ld*.so*` + do + if [[ -f $libr ]]; then + if [[ ! -f "$CURRENT_DIR/$libr" ]]; then systemNeedCommand="$systemNeedCommand --ro-bind $libr $libr " + touch "$CURRENT_DIR/$libr" + else + if [[ ! -s "$CURRENT_DIR/$libr" ]]; then + systemNeedCommand="$systemNeedCommand --ro-bind $libr $libr " + fi fi fi - fi -done + done +fi if [[ ! -d "$CURRENT_DIR/usr/lib/locale" ]]; then systemNeedCommand="$systemNeedCommand --ro-bind /usr/lib/locale /usr/lib/locale " fi -echo $systemNeedCommand + if [[ ! -d "$CURRENT_DIR/usr/lib64" ]]; then bwrap --dev-bind / / \ --bind "$CURRENT_DIR/usr/lib" /lib \ diff --git a/mainwindow.py b/mainwindow.py index 434a840..2395993 100755 --- a/mainwindow.py +++ b/mainwindow.py @@ -3076,10 +3076,11 @@ if os.path.exists(f"{programPath}/WineLib/usr"): global diyRunnerLib action = QtWidgets.QAction(f"{name}") mapLink.append(action) - action.triggered.connect(lambda: AddRunnerLib(int(str(number)))) + action.triggered.connect(lambda: DelRunnerLib(int(str(number)))) diyRunnerLib.addAction(action) def DelRunnerLib(number): os.system(f"rm -rf '{libPathList[number]}'") + QtWidgets.QMessageBox.information(window, "提示", "删除完成!") mapLink[number].setDisabled(True) for libPath in [f"{programPath}/WineLib/usr/lib", f"{programPath}/WineLib/usr/lib64"]: for i in os.listdir(libPath):