Merge branch 'Alpha' into main

This commit is contained in:
gfdgd xi 2022-09-29 21:48:46 +08:00
commit ed638a2002
74 changed files with 893 additions and 22 deletions

View File

@ -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)

13
AutoShell/command/bat Executable file
View File

@ -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"))

13
AutoShell/command/changeversion Executable file
View File

@ -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"))

13
AutoShell/command/createbotton Executable file
View File

@ -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"))

13
AutoShell/command/disbledopengl Executable file
View File

@ -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"))

13
AutoShell/command/download Executable file
View File

@ -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"))

13
AutoShell/command/enabledopengl Executable file
View File

@ -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"))

13
AutoShell/command/error Executable file
View File

@ -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"))

13
AutoShell/command/info Executable file
View File

@ -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"))

13
AutoShell/command/installdll Executable file
View File

@ -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"))

13
AutoShell/command/installdxvk Executable file
View File

@ -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"))

13
AutoShell/command/installfont Executable file
View File

@ -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"))

13
AutoShell/command/installgecko Executable file
View File

@ -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"))

13
AutoShell/command/installmono Executable file
View File

@ -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"))

13
AutoShell/command/installmsxml Executable file
View File

@ -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"))

13
AutoShell/command/installnet Executable file
View File

@ -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"))

View File

@ -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"))

13
AutoShell/command/installvcpp Executable file
View File

@ -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"))

13
AutoShell/command/pause Executable file
View File

@ -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"))

13
AutoShell/command/reg Executable file
View File

@ -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"))

13
AutoShell/command/stopdll Executable file
View File

@ -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"))

13
AutoShell/command/thank Executable file
View File

@ -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"))

13
AutoShell/command/version Executable file
View File

@ -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"))

13
AutoShell/command/warning Executable file
View File

@ -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"))

13
AutoShell/command/winecfg Executable file
View File

@ -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"))

13
AutoShell/command/winver Executable file
View File

@ -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"))

75
AutoShell/main.py Executable file
View File

@ -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}")

View File

@ -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])

View File

@ -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

View File

@ -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

Binary file not shown.

View File

@ -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

View File

@ -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)

View File

@ -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"))

View File

@ -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"))

View File

@ -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"))

View File

@ -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"))

View File

@ -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"))

View File

@ -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"))

View File

@ -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"))

View File

@ -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"))

View File

@ -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"))

View File

@ -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"))

View File

@ -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"))

View File

@ -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"))

View File

@ -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"))

View File

@ -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"))

View File

@ -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"))

View File

@ -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"))

View File

@ -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"))

View File

@ -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"))

View File

@ -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"))

View File

@ -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"))

View File

@ -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"))

View File

@ -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"))

View File

@ -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"))

View File

@ -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"))

View File

@ -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"))

View File

@ -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}")

View File

@ -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])

View File

@ -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

View File

@ -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

View File

@ -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 ISOWindows 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", "浏览"))

View File

@ -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/",

View File

@ -0,0 +1 @@
/opt/apps/deepin-wine-runner/AutoShell/main.py

View File

@ -0,0 +1 @@
/opt/apps/deepin-wine-runner/ConfigLanguareRunner.py

View File

@ -0,0 +1 @@
/opt/apps/deepin-wine-runner/AutoConfig.py

View File

@ -1 +0,0 @@
/opt/apps/deepin-wine-runner/dxvk/setup_dxvk.sh

Binary file not shown.