From ec55faf75a11f4a4527238af7f1e8ba18c26a4f9 Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Fri, 9 Sep 2022 22:23:11 +0800 Subject: [PATCH] =?UTF-8?q?MSI=E6=96=87=E4=BB=B6=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mainwindow.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mainwindow.py b/mainwindow.py index 5903e58..ac79594 100755 --- a/mainwindow.py +++ b/mainwindow.py @@ -174,10 +174,16 @@ class Runexebutton_threading(QtCore.QThread): os.remove(f"{programPath}/dlls-arm.7z") if setting["TerminalOpen"]: res = "" - OpenTerminal("env WINEPREFIX='" + wineBottonPath + "' " + option + wine[o1.currentText()] + " '" + e2.currentText() + "' " + setting["WineOption"]) + if e2.currentText()[-4:] == ".msi" and os.path.exists(e2.currentText()): + OpenTerminal("env WINEPREFIX='" + wineBottonPath + "' " + option + wine[o1.currentText()] + " msiexec /i '" + e2.currentText() + "' " + setting["WineOption"]) + else: + OpenTerminal("env WINEPREFIX='" + wineBottonPath + "' " + option + wine[o1.currentText()] + " '" + e2.currentText() + "' " + setting["WineOption"]) #res = subprocess.Popen([f"'{programPath}/launch.sh' deepin-terminal -C \"WINEPREFIX='" + wineBottonPath + "' " + option + wine[o1.currentText()] + " '" + e2.currentText() + "' " + setting["WineOption"] + "\" --keep-open" + wineUsingOption], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) else: - res = subprocess.Popen(["WINEPREFIX='" + wineBottonPath + "' " + option + wine[o1.currentText()] + " '" + e2.currentText() + "' " + setting["WineOption"]], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + if e2.currentText()[-4:] == ".msi" and os.path.exists(e2.currentText()): + res = subprocess.Popen(["WINEPREFIX='" + wineBottonPath + "' " + option + wine[o1.currentText()] + " msiexec /i '" + e2.currentText() + "' " + setting["WineOption"]], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + else: + res = subprocess.Popen(["WINEPREFIX='" + wineBottonPath + "' " + option + wine[o1.currentText()] + " '" + e2.currentText() + "' " + setting["WineOption"]], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) # 实时读取程序返回 # if not setting["TerminalOpen"]: