diff --git a/AutoConfig.py b/AutoConfig.py index 3402676..19372ff 100755 --- a/AutoConfig.py +++ b/AutoConfig.py @@ -51,17 +51,25 @@ class Connect: fileName = i[1] break # 下载脚本 + things = "" try: print(f"{urlSources}/{fileName}") file = open("/tmp/wine-runner-auto-config.wsh", "w") - file.write(requests.get(f"{urlSources}/{fileName}").text) + things = requests.get(f"{urlSources}/{fileName}").text + file.write(things) file.close() except: traceback.print_exc() QtWidgets.QMessageBox.critical(window, "错误", "无法获取配置文件") return + # 判断版本以启动对应的解释器 + # 做到新旧兼容 + if "$(" in things: + print("a") + OpenTerminal(f"env WINE='{wine}' WINEPREFIX='{wineprefix}' '{programPath}/ConfigLanguareRunner.py' '/tmp/wine-runner-auto-config.wsh' --system") # 执行脚本 - OpenTerminal(f"env WINE='{wine}' WINEPREFIX='{wineprefix}' '{programPath}/ConfigLanguareRunner.py' '/tmp/wine-runner-auto-config.wsh' --system") + print(f"env WINE='{wine}' WINEPREFIX='{wineprefix}' '{programPath}/AutoShell/main.py' '/tmp/wine-runner-auto-config.wsh'") + OpenTerminal(f"env WINE='{wine}' WINEPREFIX='{wineprefix}' '{programPath}/AutoShell/main.py' '/tmp/wine-runner-auto-config.wsh'") #process = QtCore.QProcess() #process.start(f"{programPath}/launch.sh", ["deepin-terminal", "-e", "env", f"WINE={wine}", f"WINEPREFIX={wineprefix}", f"{programPath}/ConfigLanguareRunner.py", "/tmp/wine-runner-auto-config.wsh", "--system"]) #process.waitForFinished() @@ -70,8 +78,18 @@ class Connect: path = QtWidgets.QFileDialog.getOpenFileName(window, "提示", homePath, "配置文件(*.sh *.wsh);;全部文件(*.*)") if path[0] == "": return + try: + things = "" + with open(path) as file: + things = file.read() + except: + traceback.print_exc() + # 判断版本以启动对应的解释器 + # 做到新旧兼容 + if "$(" in things: + OpenTerminal(f"env WINE='{wine}' WINEPREFIX='{wineprefix}' '{programPath}/ConfigLanguareRunner.py' '{path[0]}' --system") # 执行脚本 - OpenTerminal(f"env WINE='{wine}' WINEPREFIX='{wineprefix}' '{programPath}/ConfigLanguareRunner.py' '{path[0]}' --system") + OpenTerminal(f"env WINE='{wine}' WINEPREFIX='{wineprefix}' '{programPath}/AutoShell/main.py' '{path[0]}'") #process = QtCore.QProcess() #process.start(f"{programPath}/launch.sh", ["deepin-terminal", "-e", "env", f"WINE={wine}", f"WINEPREFIX={wineprefix}", f"{programPath}/ConfigLanguareRunner.py", path[0], "--system"]) #process.waitForFinished() @@ -100,6 +118,7 @@ if __name__ == "__main__": ui = Ui_MainWindow() ui.setupUi(window) window.setWindowTitle(f"Wine 运行器 {version}——容器自动配置部署脚本") + window.setWindowIcon(QtGui.QIcon(f"{programPath}/deepin-wine-runner.svg")) window.show() # 连接信号和槽 ui.saerchBotton.clicked.connect(Connect.SearchBotton_Clicked) diff --git a/AutoShell/command/bat b/AutoShell/command/bat new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/AutoShell/command/bat @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/changeversion b/AutoShell/command/changeversion new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/AutoShell/command/changeversion @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/createbotton b/AutoShell/command/createbotton new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/AutoShell/command/createbotton @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/disbledopengl b/AutoShell/command/disbledopengl new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/AutoShell/command/disbledopengl @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/download b/AutoShell/command/download new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/AutoShell/command/download @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/enabledopengl b/AutoShell/command/enabledopengl new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/AutoShell/command/enabledopengl @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/error b/AutoShell/command/error new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/AutoShell/command/error @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/info b/AutoShell/command/info new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/AutoShell/command/info @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/installdll b/AutoShell/command/installdll new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/AutoShell/command/installdll @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/installdxvk b/AutoShell/command/installdxvk new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/AutoShell/command/installdxvk @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/installfont b/AutoShell/command/installfont new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/AutoShell/command/installfont @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/installgecko b/AutoShell/command/installgecko new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/AutoShell/command/installgecko @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/installmono b/AutoShell/command/installmono new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/AutoShell/command/installmono @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/installmsxml b/AutoShell/command/installmsxml new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/AutoShell/command/installmsxml @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/installnet b/AutoShell/command/installnet new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/AutoShell/command/installnet @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/installsparkcorefont b/AutoShell/command/installsparkcorefont new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/AutoShell/command/installsparkcorefont @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/installvcpp b/AutoShell/command/installvcpp new file mode 100755 index 0000000..bcf4bde --- /dev/null +++ b/AutoShell/command/installvcpp @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) diff --git a/AutoShell/command/pause b/AutoShell/command/pause new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/AutoShell/command/pause @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/reg b/AutoShell/command/reg new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/AutoShell/command/reg @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/stopdll b/AutoShell/command/stopdll new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/AutoShell/command/stopdll @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/thank b/AutoShell/command/thank new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/AutoShell/command/thank @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/version b/AutoShell/command/version new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/AutoShell/command/version @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/warning b/AutoShell/command/warning new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/AutoShell/command/warning @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/winecfg b/AutoShell/command/winecfg new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/AutoShell/command/winecfg @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/winver b/AutoShell/command/winver new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/AutoShell/command/winver @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/main.py b/AutoShell/main.py new file mode 100755 index 0000000..47ea08d --- /dev/null +++ b/AutoShell/main.py @@ -0,0 +1,75 @@ +#!/usr/bin/env python3 +import os +import sys +import time +import json +import platform + +# 读取文本文档 +def readtxt(path): + f = open(path, "r") # 设置文件对象 + str = f.read() # 获取内容 + f.close() # 关闭文本对象 + return str # 返回结果 +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +information = json.loads(readtxt(f"{programPath}/../information.json")) +version = information["Version"] +thankText = "" +for i in information["Thank"]: + thankText += f"{i}\n" +programEnv = [ + ["WINEPREFIX", f"{os.path.expanduser('~')}/.wine"], + ["WINE", "deepin-wine6-stable"], + ["DANGER", "0"], + ["PROGRAMPATH", programPath], + ["VERSION", version], + ["THANK", thankText.replace("\n", "\\n")], + ["MAKER", "gfdgd xi、为什么您不喜欢熊出没和阿布呢"], + ["COPYRIGHT", f"©2020~{time.strftime('%Y')} gfdgd xi、为什么您不喜欢熊出没和阿布呢"], + ["PLATFORM", platform.system()], + ["DEBUG", str(int("--debug" in sys.argv))] +] +'''programEnv = [ + ["($WINEPREFIX)", f"{os.path.expanduser('~')}/.wine"], + ["($WINE)", "deepin-wine6-stable"], + ["($DANGER)", "0"], + ["($HOME)", os.path.expanduser('~')], + ["($PROGRAMPATH)", programPath], + ["($VERSION)", version], + ["($THANK)", thankText], + ["($MAKER)", "gfdgd xi、为什么您不喜欢熊出没和阿布呢"], + ["($COPYRIGHT)", f"©2020~{time.strftime('%Y')} gfdgd xi、为什么您不喜欢熊出没和阿布呢"], + ["?", "0"], + ["PLATFORM)", platform.system()], + ["DEBUG)", str(int("--debug" in sys.argv))] +]''' +optionAll = 0 +if "--debug" in sys.argv: + optionAll += 1 +if "--system" in sys.argv: + programEnv.append(["DANGER", "1"]) + optionAll += 1 +if os.getenv("WINE") != None: + programEnv.append(["WINE", os.getenv("WINE")]) +if os.getenv("WINEPREFIX") != None: + programEnv.append(["WINEPREFIX", os.getenv("WINEPREFIX")]) +# 生成可以使用的参数 +commandEnv = "" +for i in programEnv: + commandEnv += f"{i[0]}=\"{i[1]}\" " +commandEnv += f"PATH=\"{programPath}/command:$PATH\" " +if len(sys.argv) - optionAll < 2: + print("Wine 运行器自动配置文件解析器交互环境(基于 Bash)") + print(f"版本:{version}") + print(f"©2020~{time.strftime('%Y')} gfdgd xi、为什么您不喜欢熊出没和阿布呢") + print("--------------------------------------------------------------") + os.system(f"{commandEnv} bash ") + exit() +command = "" +for i in sys.argv[1:]: + command += f"\"{i}\" " +print("Wine 运行器自动配置文件解析器(基于 Bash)") +print(f"版本:{version}") +print(f"©2020~{time.strftime('%Y')} gfdgd xi、为什么您不喜欢熊出没和阿布呢") +print("--------------------------------------------------------------") +os.system(f"{commandEnv} bash {command}") \ No newline at end of file diff --git a/ConfigLanguareRunner.py b/ConfigLanguareRunner.py index 534c04c..2b1c65f 100755 --- a/ConfigLanguareRunner.py +++ b/ConfigLanguareRunner.py @@ -30,7 +30,8 @@ for i in information["Thank"]: programEnv = [ ["($WINEPREFIX)", f"{os.path.expanduser('~')}/.wine"], ["($WINE)", "deepin-wine6-stable"], - ["($DANGER)", "0"], + #["($DANGER)", "0"], + ["($DANGER)", "1"], ["($HOME)", os.path.expanduser('~')], ["($PROGRAMPATH)", programPath], ["($VERSION)", version], @@ -39,7 +40,8 @@ programEnv = [ ["($COPYRIGHT)", f"©2020~{time.strftime('%Y')} gfdgd xi、为什么您不喜欢熊出没和阿布呢"], ["($?)", "0"], ["($PLATFORM)", platform.system()], - ["($DEBUG)", str(int("--debug" in sys.argv))] + ["($DEBUG)", "1"] + #["($DEBUG)", str(int("--debug" in sys.argv))] ] readOnlyEnv = [ "($DANGER)", @@ -259,7 +261,6 @@ class Command(): commandStr = command[0] + " " for i in command[1:]: commandStr += f"'{i}' " - print(commandStr) return os.system(commandStr) def Version(self): @@ -448,8 +449,8 @@ class Command(): if self.close: break +app = QtWidgets.QApplication(sys.argv) if __name__ == "__main__": - app = QtWidgets.QApplication(sys.argv) optionAll = 0 if "--debug" in sys.argv: optionAll += 1 @@ -480,4 +481,8 @@ if __name__ == "__main__": except: print("错误:无法读取该文件,无法继续") sys.exit(1) + print("Wine 运行器自动配置文件解析器") + print(f"版本:{version}") + print(f"©2020~{time.strftime('%Y')} gfdgd xi、为什么您不喜欢熊出没和阿布呢") + print("--------------------------------------------------------------") com.Run(com.GetCommandList(), programEnv[0][1], programEnv[1][1]) \ No newline at end of file diff --git a/InstallDll.py b/InstallDll.py index 1d07749..cff3675 100755 --- a/InstallDll.py +++ b/InstallDll.py @@ -48,6 +48,7 @@ def Download(wineBotton, dllName, urlPart, wine: str) -> bool: except: pass os.system(f"aria2c -x 16 -s 16 -d '{wineBotton}/drive_c/windows/system32' -o '{dllName}' '{urlPart}'") + #print(f"WINEPREFIX='{wineBotton}' {wine} reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v {os.path.splitext(dllName)[0]} /d native /f") os.system(f"WINEPREFIX='{wineBotton}' {wine} reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v {os.path.splitext(dllName)[0]} /d native /f") return 0 diff --git a/Makefile b/Makefile index a71207e..e421437 100755 --- a/Makefile +++ b/Makefile @@ -15,6 +15,7 @@ build: cp -rv req deb/opt/apps/deepin-wine-runner cp -rv RegShot deb/opt/apps/deepin-wine-runner cp -rv BeCyIconGrabber.exe deb/opt/apps/deepin-wine-runner + cp -rv AutoShell deb/opt/apps/deepin-wine-runner cp -rv deepin-wine-packager-with-script.py deb/opt/apps/deepin-wine-runner cp -rv deepin-wine-packager.py deb/opt/apps/deepin-wine-runner cp -rv deepin-wine-runner-update-bug deb/opt/apps/deepin-wine-runner diff --git a/__pycache__/ConfigLanguareRunner.cpython-37.pyc b/__pycache__/ConfigLanguareRunner.cpython-37.pyc new file mode 100644 index 0000000..affb5a6 Binary files /dev/null and b/__pycache__/ConfigLanguareRunner.cpython-37.pyc differ diff --git a/__pycache__/InstallDll.cpython-37.pyc b/__pycache__/InstallDll.cpython-37.pyc index ba86a66..31351b4 100644 Binary files a/__pycache__/InstallDll.cpython-37.pyc and b/__pycache__/InstallDll.cpython-37.pyc differ diff --git a/__pycache__/InstallFont.cpython-37.pyc b/__pycache__/InstallFont.cpython-37.pyc index 7f2e1dd..7f0871e 100644 Binary files a/__pycache__/InstallFont.cpython-37.pyc and b/__pycache__/InstallFont.cpython-37.pyc differ diff --git a/__pycache__/InstallMsxml.cpython-37.pyc b/__pycache__/InstallMsxml.cpython-37.pyc index 68c0bc6..9cf0dda 100644 Binary files a/__pycache__/InstallMsxml.cpython-37.pyc and b/__pycache__/InstallMsxml.cpython-37.pyc differ diff --git a/__pycache__/InstallVisualCPlusPlus.cpython-37.pyc b/__pycache__/InstallVisualCPlusPlus.cpython-37.pyc index ae27162..5dc520b 100644 Binary files a/__pycache__/InstallVisualCPlusPlus.cpython-37.pyc and b/__pycache__/InstallVisualCPlusPlus.cpython-37.pyc differ diff --git a/deb/DEBIAN/postinst b/deb/DEBIAN/postinst index 5b8ab96..6887979 100755 --- a/deb/DEBIAN/postinst +++ b/deb/DEBIAN/postinst @@ -2,8 +2,8 @@ # 使用系统默认的 sh 运行 ################################################################################################################# # 作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢 -# 版本:2.2.0 -# 更新时间:2022年09月24日 +# 版本:2.2.1 +# 更新时间:2022年09月29日 # 感谢:感谢 wine、deepin-wine 以及星火团队,提供了 wine、deepin-wine、spark-wine-devel 给大家使用,让我能做这个程序 # 基于 sh ################################################################################################################# @@ -32,4 +32,4 @@ fi # 设置目录权限,让用户可读可写,方便后续删除组件 chmod 777 -R /opt/apps/deepin-wine-runner # 向服务器返回安装数加1(不显示内容且忽略错误) -curl https://304626p927.goho.co/spark-deepin-wine-runner/Install.php?Version=2.2.0-1 -s > /dev/null | true +curl https://304626p927.goho.co/spark-deepin-wine-runner/Install.php?Version=2.2.1 -s > /dev/null | true diff --git a/deb/opt/apps/deepin-wine-runner/AutoConfig.py b/deb/opt/apps/deepin-wine-runner/AutoConfig.py index 3402676..19372ff 100755 --- a/deb/opt/apps/deepin-wine-runner/AutoConfig.py +++ b/deb/opt/apps/deepin-wine-runner/AutoConfig.py @@ -51,17 +51,25 @@ class Connect: fileName = i[1] break # 下载脚本 + things = "" try: print(f"{urlSources}/{fileName}") file = open("/tmp/wine-runner-auto-config.wsh", "w") - file.write(requests.get(f"{urlSources}/{fileName}").text) + things = requests.get(f"{urlSources}/{fileName}").text + file.write(things) file.close() except: traceback.print_exc() QtWidgets.QMessageBox.critical(window, "错误", "无法获取配置文件") return + # 判断版本以启动对应的解释器 + # 做到新旧兼容 + if "$(" in things: + print("a") + OpenTerminal(f"env WINE='{wine}' WINEPREFIX='{wineprefix}' '{programPath}/ConfigLanguareRunner.py' '/tmp/wine-runner-auto-config.wsh' --system") # 执行脚本 - OpenTerminal(f"env WINE='{wine}' WINEPREFIX='{wineprefix}' '{programPath}/ConfigLanguareRunner.py' '/tmp/wine-runner-auto-config.wsh' --system") + print(f"env WINE='{wine}' WINEPREFIX='{wineprefix}' '{programPath}/AutoShell/main.py' '/tmp/wine-runner-auto-config.wsh'") + OpenTerminal(f"env WINE='{wine}' WINEPREFIX='{wineprefix}' '{programPath}/AutoShell/main.py' '/tmp/wine-runner-auto-config.wsh'") #process = QtCore.QProcess() #process.start(f"{programPath}/launch.sh", ["deepin-terminal", "-e", "env", f"WINE={wine}", f"WINEPREFIX={wineprefix}", f"{programPath}/ConfigLanguareRunner.py", "/tmp/wine-runner-auto-config.wsh", "--system"]) #process.waitForFinished() @@ -70,8 +78,18 @@ class Connect: path = QtWidgets.QFileDialog.getOpenFileName(window, "提示", homePath, "配置文件(*.sh *.wsh);;全部文件(*.*)") if path[0] == "": return + try: + things = "" + with open(path) as file: + things = file.read() + except: + traceback.print_exc() + # 判断版本以启动对应的解释器 + # 做到新旧兼容 + if "$(" in things: + OpenTerminal(f"env WINE='{wine}' WINEPREFIX='{wineprefix}' '{programPath}/ConfigLanguareRunner.py' '{path[0]}' --system") # 执行脚本 - OpenTerminal(f"env WINE='{wine}' WINEPREFIX='{wineprefix}' '{programPath}/ConfigLanguareRunner.py' '{path[0]}' --system") + OpenTerminal(f"env WINE='{wine}' WINEPREFIX='{wineprefix}' '{programPath}/AutoShell/main.py' '{path[0]}'") #process = QtCore.QProcess() #process.start(f"{programPath}/launch.sh", ["deepin-terminal", "-e", "env", f"WINE={wine}", f"WINEPREFIX={wineprefix}", f"{programPath}/ConfigLanguareRunner.py", path[0], "--system"]) #process.waitForFinished() @@ -100,6 +118,7 @@ if __name__ == "__main__": ui = Ui_MainWindow() ui.setupUi(window) window.setWindowTitle(f"Wine 运行器 {version}——容器自动配置部署脚本") + window.setWindowIcon(QtGui.QIcon(f"{programPath}/deepin-wine-runner.svg")) window.show() # 连接信号和槽 ui.saerchBotton.clicked.connect(Connect.SearchBotton_Clicked) diff --git a/deb/opt/apps/deepin-wine-runner/AutoShell/command/bat b/deb/opt/apps/deepin-wine-runner/AutoShell/command/bat new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/AutoShell/command/bat @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/AutoShell/command/changeversion b/deb/opt/apps/deepin-wine-runner/AutoShell/command/changeversion new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/AutoShell/command/changeversion @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/AutoShell/command/createbotton b/deb/opt/apps/deepin-wine-runner/AutoShell/command/createbotton new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/AutoShell/command/createbotton @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/AutoShell/command/disbledopengl b/deb/opt/apps/deepin-wine-runner/AutoShell/command/disbledopengl new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/AutoShell/command/disbledopengl @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/AutoShell/command/download b/deb/opt/apps/deepin-wine-runner/AutoShell/command/download new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/AutoShell/command/download @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/AutoShell/command/enabledopengl b/deb/opt/apps/deepin-wine-runner/AutoShell/command/enabledopengl new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/AutoShell/command/enabledopengl @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/AutoShell/command/error b/deb/opt/apps/deepin-wine-runner/AutoShell/command/error new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/AutoShell/command/error @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/AutoShell/command/info b/deb/opt/apps/deepin-wine-runner/AutoShell/command/info new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/AutoShell/command/info @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/AutoShell/command/installdll b/deb/opt/apps/deepin-wine-runner/AutoShell/command/installdll new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/AutoShell/command/installdll @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/AutoShell/command/installdxvk b/deb/opt/apps/deepin-wine-runner/AutoShell/command/installdxvk new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/AutoShell/command/installdxvk @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/AutoShell/command/installfont b/deb/opt/apps/deepin-wine-runner/AutoShell/command/installfont new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/AutoShell/command/installfont @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/AutoShell/command/installgecko b/deb/opt/apps/deepin-wine-runner/AutoShell/command/installgecko new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/AutoShell/command/installgecko @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/AutoShell/command/installmono b/deb/opt/apps/deepin-wine-runner/AutoShell/command/installmono new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/AutoShell/command/installmono @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/AutoShell/command/installmsxml b/deb/opt/apps/deepin-wine-runner/AutoShell/command/installmsxml new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/AutoShell/command/installmsxml @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/AutoShell/command/installnet b/deb/opt/apps/deepin-wine-runner/AutoShell/command/installnet new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/AutoShell/command/installnet @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/AutoShell/command/installsparkcorefont b/deb/opt/apps/deepin-wine-runner/AutoShell/command/installsparkcorefont new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/AutoShell/command/installsparkcorefont @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/AutoShell/command/installvcpp b/deb/opt/apps/deepin-wine-runner/AutoShell/command/installvcpp new file mode 100755 index 0000000..bcf4bde --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/AutoShell/command/installvcpp @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) diff --git a/deb/opt/apps/deepin-wine-runner/AutoShell/command/pause b/deb/opt/apps/deepin-wine-runner/AutoShell/command/pause new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/AutoShell/command/pause @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/AutoShell/command/reg b/deb/opt/apps/deepin-wine-runner/AutoShell/command/reg new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/AutoShell/command/reg @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/AutoShell/command/stopdll b/deb/opt/apps/deepin-wine-runner/AutoShell/command/stopdll new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/AutoShell/command/stopdll @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/AutoShell/command/thank b/deb/opt/apps/deepin-wine-runner/AutoShell/command/thank new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/AutoShell/command/thank @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/AutoShell/command/version b/deb/opt/apps/deepin-wine-runner/AutoShell/command/version new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/AutoShell/command/version @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/AutoShell/command/warning b/deb/opt/apps/deepin-wine-runner/AutoShell/command/warning new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/AutoShell/command/warning @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/AutoShell/command/winecfg b/deb/opt/apps/deepin-wine-runner/AutoShell/command/winecfg new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/AutoShell/command/winecfg @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/AutoShell/command/winver b/deb/opt/apps/deepin-wine-runner/AutoShell/command/winver new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/AutoShell/command/winver @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/AutoShell/main.py b/deb/opt/apps/deepin-wine-runner/AutoShell/main.py new file mode 100755 index 0000000..47ea08d --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/AutoShell/main.py @@ -0,0 +1,75 @@ +#!/usr/bin/env python3 +import os +import sys +import time +import json +import platform + +# 读取文本文档 +def readtxt(path): + f = open(path, "r") # 设置文件对象 + str = f.read() # 获取内容 + f.close() # 关闭文本对象 + return str # 返回结果 +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +information = json.loads(readtxt(f"{programPath}/../information.json")) +version = information["Version"] +thankText = "" +for i in information["Thank"]: + thankText += f"{i}\n" +programEnv = [ + ["WINEPREFIX", f"{os.path.expanduser('~')}/.wine"], + ["WINE", "deepin-wine6-stable"], + ["DANGER", "0"], + ["PROGRAMPATH", programPath], + ["VERSION", version], + ["THANK", thankText.replace("\n", "\\n")], + ["MAKER", "gfdgd xi、为什么您不喜欢熊出没和阿布呢"], + ["COPYRIGHT", f"©2020~{time.strftime('%Y')} gfdgd xi、为什么您不喜欢熊出没和阿布呢"], + ["PLATFORM", platform.system()], + ["DEBUG", str(int("--debug" in sys.argv))] +] +'''programEnv = [ + ["($WINEPREFIX)", f"{os.path.expanduser('~')}/.wine"], + ["($WINE)", "deepin-wine6-stable"], + ["($DANGER)", "0"], + ["($HOME)", os.path.expanduser('~')], + ["($PROGRAMPATH)", programPath], + ["($VERSION)", version], + ["($THANK)", thankText], + ["($MAKER)", "gfdgd xi、为什么您不喜欢熊出没和阿布呢"], + ["($COPYRIGHT)", f"©2020~{time.strftime('%Y')} gfdgd xi、为什么您不喜欢熊出没和阿布呢"], + ["?", "0"], + ["PLATFORM)", platform.system()], + ["DEBUG)", str(int("--debug" in sys.argv))] +]''' +optionAll = 0 +if "--debug" in sys.argv: + optionAll += 1 +if "--system" in sys.argv: + programEnv.append(["DANGER", "1"]) + optionAll += 1 +if os.getenv("WINE") != None: + programEnv.append(["WINE", os.getenv("WINE")]) +if os.getenv("WINEPREFIX") != None: + programEnv.append(["WINEPREFIX", os.getenv("WINEPREFIX")]) +# 生成可以使用的参数 +commandEnv = "" +for i in programEnv: + commandEnv += f"{i[0]}=\"{i[1]}\" " +commandEnv += f"PATH=\"{programPath}/command:$PATH\" " +if len(sys.argv) - optionAll < 2: + print("Wine 运行器自动配置文件解析器交互环境(基于 Bash)") + print(f"版本:{version}") + print(f"©2020~{time.strftime('%Y')} gfdgd xi、为什么您不喜欢熊出没和阿布呢") + print("--------------------------------------------------------------") + os.system(f"{commandEnv} bash ") + exit() +command = "" +for i in sys.argv[1:]: + command += f"\"{i}\" " +print("Wine 运行器自动配置文件解析器(基于 Bash)") +print(f"版本:{version}") +print(f"©2020~{time.strftime('%Y')} gfdgd xi、为什么您不喜欢熊出没和阿布呢") +print("--------------------------------------------------------------") +os.system(f"{commandEnv} bash {command}") \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/ConfigLanguareRunner.py b/deb/opt/apps/deepin-wine-runner/ConfigLanguareRunner.py index 534c04c..2b1c65f 100755 --- a/deb/opt/apps/deepin-wine-runner/ConfigLanguareRunner.py +++ b/deb/opt/apps/deepin-wine-runner/ConfigLanguareRunner.py @@ -30,7 +30,8 @@ for i in information["Thank"]: programEnv = [ ["($WINEPREFIX)", f"{os.path.expanduser('~')}/.wine"], ["($WINE)", "deepin-wine6-stable"], - ["($DANGER)", "0"], + #["($DANGER)", "0"], + ["($DANGER)", "1"], ["($HOME)", os.path.expanduser('~')], ["($PROGRAMPATH)", programPath], ["($VERSION)", version], @@ -39,7 +40,8 @@ programEnv = [ ["($COPYRIGHT)", f"©2020~{time.strftime('%Y')} gfdgd xi、为什么您不喜欢熊出没和阿布呢"], ["($?)", "0"], ["($PLATFORM)", platform.system()], - ["($DEBUG)", str(int("--debug" in sys.argv))] + ["($DEBUG)", "1"] + #["($DEBUG)", str(int("--debug" in sys.argv))] ] readOnlyEnv = [ "($DANGER)", @@ -259,7 +261,6 @@ class Command(): commandStr = command[0] + " " for i in command[1:]: commandStr += f"'{i}' " - print(commandStr) return os.system(commandStr) def Version(self): @@ -448,8 +449,8 @@ class Command(): if self.close: break +app = QtWidgets.QApplication(sys.argv) if __name__ == "__main__": - app = QtWidgets.QApplication(sys.argv) optionAll = 0 if "--debug" in sys.argv: optionAll += 1 @@ -480,4 +481,8 @@ if __name__ == "__main__": except: print("错误:无法读取该文件,无法继续") sys.exit(1) + print("Wine 运行器自动配置文件解析器") + print(f"版本:{version}") + print(f"©2020~{time.strftime('%Y')} gfdgd xi、为什么您不喜欢熊出没和阿布呢") + print("--------------------------------------------------------------") com.Run(com.GetCommandList(), programEnv[0][1], programEnv[1][1]) \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/InstallDll.py b/deb/opt/apps/deepin-wine-runner/InstallDll.py index 1d07749..cff3675 100755 --- a/deb/opt/apps/deepin-wine-runner/InstallDll.py +++ b/deb/opt/apps/deepin-wine-runner/InstallDll.py @@ -48,6 +48,7 @@ def Download(wineBotton, dllName, urlPart, wine: str) -> bool: except: pass os.system(f"aria2c -x 16 -s 16 -d '{wineBotton}/drive_c/windows/system32' -o '{dllName}' '{urlPart}'") + #print(f"WINEPREFIX='{wineBotton}' {wine} reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v {os.path.splitext(dllName)[0]} /d native /f") os.system(f"WINEPREFIX='{wineBotton}' {wine} reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v {os.path.splitext(dllName)[0]} /d native /f") return 0 diff --git a/deb/opt/apps/deepin-wine-runner/LANG/InstallDll.py b/deb/opt/apps/deepin-wine-runner/LANG/InstallDll.py index 1d07749..cff3675 100755 --- a/deb/opt/apps/deepin-wine-runner/LANG/InstallDll.py +++ b/deb/opt/apps/deepin-wine-runner/LANG/InstallDll.py @@ -48,6 +48,7 @@ def Download(wineBotton, dllName, urlPart, wine: str) -> bool: except: pass os.system(f"aria2c -x 16 -s 16 -d '{wineBotton}/drive_c/windows/system32' -o '{dllName}' '{urlPart}'") + #print(f"WINEPREFIX='{wineBotton}' {wine} reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v {os.path.splitext(dllName)[0]} /d native /f") os.system(f"WINEPREFIX='{wineBotton}' {wine} reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v {os.path.splitext(dllName)[0]} /d native /f") return 0 diff --git a/deb/opt/apps/deepin-wine-runner/deepin-wine-runner b/deb/opt/apps/deepin-wine-runner/deepin-wine-runner index 21b3a51..31c851e 100755 --- a/deb/opt/apps/deepin-wine-runner/deepin-wine-runner +++ b/deb/opt/apps/deepin-wine-runner/deepin-wine-runner @@ -1016,7 +1016,7 @@ class GetDllFromWindowsISO: traceback.print_exc() QtWidgets.QMessageBox.critical(GetDllFromWindowsISO.message, "错误", traceback.format_exc()) - + def MountDisk(): if not os.path.exists(GetDllFromWindowsISO.isoPath.currentText()): QtWidgets.QMessageBox.critical(GetDllFromWindowsISO.message, "错误", "您选择的 ISO 镜像文件不存在") @@ -1024,7 +1024,7 @@ class GetDllFromWindowsISO: if os.path.exists("/tmp/wine-runner-getdll"): try: os.rmdir("/tmp/wine-runner-getdll") - os.rmdir("/tmp/wine-runner-getdll-wim") + os.system("rm -rf /tmp/wine-runner-getdll-wim") except: # 如果无法删除可能是挂载了文件 os.system("wimunmount /tmp/wine-runner-getdll-wim") @@ -1042,6 +1042,10 @@ class GetDllFromWindowsISO: findList = [] # 判断是新版的 Windows ISO(Windows Vista 及以上版本) if os.path.exists("/tmp/wine-runner-getdll/sources/install.wim"): + # 如果没有安装 wimtools 的话 + if os.system("which wimmount") != 0: + QtWidgets.QMessageBox.critical(GetDllFromWindowsISO.message, "错误", f"镜像内容读取/挂载失败,因为没有安装 wimtools 以至无法读取") + return # 是新版,挂载 wim # 需要让用户选择挂载内容 QtWidgets.QInputDialog.getMultiLineText(GetDllFromWindowsISO.message, "提示", "挂载文件需要用户记住并在下一个对话框输入 Index 以挂载正确的镜像,按下下方任意按钮即可继续", subprocess.getoutput("wiminfo '/tmp/wine-runner-getdll/sources/install.wim'")) @@ -1339,6 +1343,7 @@ class ProgramSetting(): autoWine = None runtimeCache = None buildByBottleName = None + autoPath = None def ShowWindow(): ProgramSetting.message = QtWidgets.QMainWindow() widget = QtWidgets.QWidget() @@ -1354,6 +1359,7 @@ class ProgramSetting(): widgetLayout.addWidget(QtWidgets.QLabel(QtCore.QCoreApplication.translate("U", "忽略未安装的 Wine:")), 8, 0, 1, 1) widgetLayout.addWidget(QtWidgets.QLabel(QtCore.QCoreApplication.translate("U", "下载缓存:")), 9, 0, 1, 1) widgetLayout.addWidget(QtWidgets.QLabel(QtCore.QCoreApplication.translate("U", "图标生成:")), 10, 0, 1, 1) + widgetLayout.addWidget(QtWidgets.QLabel(QtCore.QCoreApplication.translate("U", "自动根据EXE名称生成路径:")), 11, 0, 1, 1) ProgramSetting.wineBottonA = QtWidgets.QComboBox() ProgramSetting.wineDebug = QtWidgets.QCheckBox(QtCore.QCoreApplication.translate("U", "开启 DEBUG 输出")) ProgramSetting.defultWine = QtWidgets.QComboBox() @@ -1373,6 +1379,7 @@ class ProgramSetting(): ProgramSetting.autoWine = QtWidgets.QCheckBox(QtCore.QCoreApplication.translate("U", "不显示未检测到的 Wine")) ProgramSetting.runtimeCache = QtWidgets.QCheckBox(QtCore.QCoreApplication.translate("U", "开启下载缓存")) ProgramSetting.buildByBottleName = QtWidgets.QCheckBox(QtCore.QCoreApplication.translate("U", "本软件构建的图标后面添加容器名")) + ProgramSetting.autoPath = QtWidgets.QCheckBox(QtCore.QCoreApplication.translate("U", "自动根据文件名生成容器路径(开启后必须通过修改默认wine容器路径才可指定其它路径,重启后生效)")) ProgramSetting.wineBottonA.addItems(["Auto", "win32", "win64"]) ProgramSetting.wineBottonA.setCurrentText(setting["Architecture"]) ProgramSetting.wineDebug.setChecked(setting["Debug"]) @@ -1385,6 +1392,7 @@ class ProgramSetting(): ProgramSetting.autoWine.setChecked(setting["AutoWine"]) ProgramSetting.runtimeCache.setChecked(setting["RuntimeCache"]) ProgramSetting.buildByBottleName.setChecked(setting["BuildByBottleName"]) + ProgramSetting.autoPath.setChecked(setting["AutoPath"]) widgetLayout.addWidget(ProgramSetting.wineBottonA, 0, 1, 1, 1) widgetLayout.addWidget(ProgramSetting.wineDebug, 1, 1, 1, 1) widgetLayout.addWidget(ProgramSetting.defultWine, 2, 1, 1, 1) @@ -1398,7 +1406,8 @@ class ProgramSetting(): widgetLayout.addWidget(ProgramSetting.autoWine, 8, 1, 1, 1) widgetLayout.addWidget(ProgramSetting.runtimeCache, 9, 1, 1, 1) widgetLayout.addWidget(ProgramSetting.buildByBottleName, 10, 1, 1, 1) - widgetLayout.addWidget(save, 11, 2, 1, 1) + widgetLayout.addWidget(ProgramSetting.autoPath, 11, 1, 1, 2) + widgetLayout.addWidget(save, 12, 2, 1, 1) widget.setLayout(widgetLayout) ProgramSetting.message.setCentralWidget(widget) ProgramSetting.message.setWindowIcon(QtGui.QIcon(iconPath)) @@ -1427,6 +1436,7 @@ class ProgramSetting(): setting["AutoWine"] = ProgramSetting.autoWine.isChecked() setting["RuntimeCache"] = ProgramSetting.runtimeCache.isChecked() setting["BuildByBottleName"] = ProgramSetting.buildByBottleName.isChecked() + setting["AutoPath"] = ProgramSetting.autoPath.isChecked() try: write_txt(get_home() + "/.config/deepin-wine-runner/WineSetting.json", json.dumps(setting)) except: @@ -1533,6 +1543,9 @@ class ValueCheck(): traceback.print_exc() QtWidgets.QMessageBox.critical(window, "错误", traceback.format_exc()) +def ChangePath(): + e1.setCurrentText(f'{setting["DefultBotton"]}/{os.path.splitext(os.path.basename(e2.currentText()))[0]}') + ########################### # 加载配置 ########################### @@ -1550,7 +1563,8 @@ defultProgramList = { "AutoWine": True, "RuntimeCache": True, "MustRead": False, - "BuildByBottleName": False + "BuildByBottleName": False, + "AutoPath": False } if not os.path.exists(get_home() + "/.config/deepin-wine-runner"): # 如果没有配置文件夹 os.mkdir(get_home() + "/.config/deepin-wine-runner") # 创建配置文件夹 @@ -1905,6 +1919,8 @@ button1.clicked.connect(liulanbutton) leftUpLayout.addWidget(button1, 3, 1, 1, 1) leftUpLayout.addWidget(QtWidgets.QLabel(QtCore.QCoreApplication.translate("U", "请选择要执行的程序:")), 4, 0, 1, 1) e2 = QtWidgets.QComboBox() +if setting["AutoPath"]: + e2.editTextChanged.connect(ChangePath) e2.setEditable(True) leftUpLayout.addWidget(e2, 5, 0, 1, 1) button2 = QtWidgets.QPushButton(QtCore.QCoreApplication.translate("U", "浏览")) diff --git a/deb/opt/apps/deepin-wine-runner/information.json b/deb/opt/apps/deepin-wine-runner/information.json index ac60368..b289e39 100755 --- a/deb/opt/apps/deepin-wine-runner/information.json +++ b/deb/opt/apps/deepin-wine-runner/information.json @@ -28,6 +28,7 @@ "感谢 @俊生鹏程 反馈的 2.1.0-2 及以前版本在鲲鹏运行 wine 错误的问题并积极测试,以及组件安装工具在 arm 架构的异常", "感谢 @云的眼泪 反馈的 2.1.0-2 更新死循环的问题,可见:https://bbs.deepin.org/post/243241,以及感谢 @神末shenmo @忘记、过去 和 @历山居士 的讨论", "感谢 @186******75 反馈的 2.2.0 基于生态适配脚本打包器对话框异常的问题", + "", "感谢统信在 Wine 生态适配活动中提供的打包脚本", "也感谢 DXVK 的开发者开发了 DXVK 这个程序,项目链接:https://github.com/doitsujin/dxvk", "也感谢 WineHQ 开发团队开发的 WineHQ,项目网址:https://dl.winehq.org/", diff --git a/deb/opt/apps/deepin-wine-runner/package-script.zip b/deb/opt/apps/deepin-wine-runner/package-script.zip index dcf35da..d55821c 100755 Binary files a/deb/opt/apps/deepin-wine-runner/package-script.zip and b/deb/opt/apps/deepin-wine-runner/package-script.zip differ diff --git a/deb/usr/bin/deepin-wine-runner-auto-install-bash b/deb/usr/bin/deepin-wine-runner-auto-install-bash new file mode 120000 index 0000000..f2b2a30 --- /dev/null +++ b/deb/usr/bin/deepin-wine-runner-auto-install-bash @@ -0,0 +1 @@ +/opt/apps/deepin-wine-runner/AutoShell/main.py \ No newline at end of file diff --git a/deb/usr/bin/deepin-wine-runner-auto-install-config-old b/deb/usr/bin/deepin-wine-runner-auto-install-config-old new file mode 120000 index 0000000..3e3f67e --- /dev/null +++ b/deb/usr/bin/deepin-wine-runner-auto-install-config-old @@ -0,0 +1 @@ +/opt/apps/deepin-wine-runner/ConfigLanguareRunner.py \ No newline at end of file diff --git a/deb/usr/bin/deepin-wine-runner-auto-install-gui b/deb/usr/bin/deepin-wine-runner-auto-install-gui new file mode 120000 index 0000000..f886374 --- /dev/null +++ b/deb/usr/bin/deepin-wine-runner-auto-install-gui @@ -0,0 +1 @@ +/opt/apps/deepin-wine-runner/AutoConfig.py \ No newline at end of file diff --git a/deb/usr/bin/deepin-wine-runner-wine-dxvk-setup b/deb/usr/bin/deepin-wine-runner-wine-dxvk-setup deleted file mode 120000 index 51b488f..0000000 --- a/deb/usr/bin/deepin-wine-runner-wine-dxvk-setup +++ /dev/null @@ -1 +0,0 @@ -/opt/apps/deepin-wine-runner/dxvk/setup_dxvk.sh \ No newline at end of file diff --git a/package-script.zip b/package-script.zip index dcf35da..d55821c 100755 Binary files a/package-script.zip and b/package-script.zip differ