docker模式

This commit is contained in:
gfdgd xi 2022-11-16 22:57:19 +08:00
parent 9d330cd147
commit 386022ea36
7 changed files with 121 additions and 74 deletions

View File

@ -1244,10 +1244,15 @@ Description: {e3_text.text()}
["@@@APPRUN_CMD@@@", wine[wineVersion.currentText()]], ["@@@APPRUN_CMD@@@", wine[wineVersion.currentText()]],
["@@@EXEC_NAME@@@", os.path.basename(e7_text.text().replace("\\", "/"))] ["@@@EXEC_NAME@@@", os.path.basename(e7_text.text().replace("\\", "/"))]
] ]
line = "\\"
if desktopIconTab.count() <= 1: if desktopIconTab.count() <= 1:
write_txt("{}/opt/apps/{}/entries/applications/{}.desktop".format(debPackagePath, e1_text.text(), e1_text.text()), '#!/usr/bin/env xdg-open\n[Desktop Entry]\nEncoding=UTF-8\nType=Application\nX-Created-By={}\nCategories={};\nIcon={}\nExec="/opt/apps/{}/files/run.sh" --uri {}\nName={}\nComment={}\nMimeType={}\nGenericName={}\nTerminal=false\nStartupNotify=false\n'.format(e4_text.text(), option1_text.currentText(), a, e1_text.text(), e15_text.text(), e8_text.text(), e3_text.text(), e10_text.text(), e1_text.text())) write_txt("{}/opt/apps/{}/entries/applications/{}.desktop".format(debPackagePath, e1_text.text(), e1_text.text()), '#!/usr/bin/env xdg-open\n[Desktop Entry]\nEncoding=UTF-8\nType=Application\nX-Created-By={}\nCategories={};\nIcon={}\nExec="/opt/apps/{}/files/run.sh" --uri {}\nName={}\nComment={}\nMimeType={}\nGenericName={}\nTerminal=false\nStartupNotify=false\n'.format(e4_text.text(), option1_text.currentText(), a, e1_text.text(), e15_text.text(), e8_text.text(), e3_text.text(), e10_text.text(), e1_text.text()))
else: else:
for i in range(len(iconUiList)): for i in range(len(iconUiList)):
if iconUiList[i][2].text().replace(" ", "") == "":
command = f"--uri {iconUiList[i][2].text()}"
else:
command = iconUiList[i][2].text()
write_txt("{}/opt/apps/{}/entries/applications/{}-{}.desktop".format(debPackagePath, e1_text.text(), e1_text.text(), os.path.splitext(os.path.basename(iconUiList[i][0].text().replace("\\", "/")))[0]), f'''#!/usr/bin/env xdg-open write_txt("{}/opt/apps/{}/entries/applications/{}-{}.desktop".format(debPackagePath, e1_text.text(), e1_text.text(), os.path.splitext(os.path.basename(iconUiList[i][0].text().replace("\\", "/")))[0]), f'''#!/usr/bin/env xdg-open
[Desktop Entry] [Desktop Entry]
Encoding=UTF-8 Encoding=UTF-8
@ -1255,7 +1260,7 @@ Type=Application
X-Created-By={e4_text.text()} X-Created-By={e4_text.text()}
Categories={iconUiList[i][1].currentText()}; Categories={iconUiList[i][1].currentText()};
Icon={a[i]} Icon={a[i]}
Exec="/opt/apps/{e1_text.text()}/files/run.sh" --uri {iconUiList[i][2].text()} Exec="/opt/apps/{e1_text.text()}/files/{os.path.splitext(os.path.basename(iconUiList[i][0].text().replace(line, "/")))[0]}.sh" {command}
Name={iconUiList[i][3].text()} Name={iconUiList[i][3].text()}
Comment={e3_text.text()} Comment={e3_text.text()}
MimeType={e10_text.text()} MimeType={e10_text.text()}

View File

@ -1880,7 +1880,9 @@ updateThingsString = '''※1、容器自动配置脚本 GUI 查看介绍使用 Q
※2、不基于生态适配活动脚本打包器跟进 arm 架构 2022年11月11日的 Wine 微信打包方式 ※2、不基于生态适配活动脚本打包器跟进 arm 架构 2022年11月11日的 Wine 微信打包方式
※3、支持多图标的程序打包 ※3、支持多图标的程序打包
※4、修复了安装更多 Wine 换源换了个寂寞的问题 ※4、修复了安装更多 Wine 换源换了个寂寞的问题
5、修复了不基于生态适配活动脚本打包器在选择 arm 打包架构下容器自动删除脚本取消勾选无用的问题 ※5、修复安装更多 Wine 重新安装后列表丢失的问题
※6、新增了对 Deepin 23 Alpha 优化的 Wine 安装器
7、修复了不基于生态适配活动脚本打包器在选择 arm 打包架构下容器自动删除脚本取消勾选无用的问题
''' '''
for i in information["Thank"]: for i in information["Thank"]:
thankText += f"{i}\n" thankText += f"{i}\n"

View File

@ -115,8 +115,13 @@ def ReadLocalInformation():
ui.localWineList.setModel(nmodel) ui.localWineList.setModel(nmodel)
file.close() file.close()
except: except:
traceback.print_exc() print("新建空列表")
QtWidgets.QMessageBox.critical(window, "错误", traceback.format_exc()) try:
with open(f"{programPath}/winelist.json", "w") as file:
file.write("[]")
except:
traceback.print_exc()
QtWidgets.QMessageBox.critical(window, "错误", traceback.format_exc())
def InstallOtherWine(): def InstallOtherWine():
path = QtWidgets.QFileDialog.getOpenFileName(window, "选择 Wine", os.getenv("~"), "wine(wine);;wine64(wine64);;全部文件(*.*)") path = QtWidgets.QFileDialog.getOpenFileName(window, "选择 Wine", os.getenv("~"), "wine(wine);;wine64(wine64);;全部文件(*.*)")

View File

@ -62,6 +62,8 @@ def disabled_or_NORMAL_all(choose):
button4.setDisabled(choose) button4.setDisabled(choose)
button5.setDisabled(choose) button5.setDisabled(choose)
option1_text.setDisabled(choose) option1_text.setDisabled(choose)
desktopIconTab.setDisabled(choose)
build7z.setDisabled(choose)
chooseWineHelperValue.setDisabled(choose) chooseWineHelperValue.setDisabled(choose)
wineVersion.setDisabled(choose) wineVersion.setDisabled(choose)
debArch.setDisabled(choose) debArch.setDisabled(choose)
@ -920,7 +922,7 @@ ACTIVEX_NAME=""
BOTTLENAME="@@@BOTTLENAME@@@" BOTTLENAME="@@@BOTTLENAME@@@"
APPVER="@@@APPVER@@@" APPVER="@@@APPVER@@@"
EXEC_PATH="@@@EXEC_PATH@@@" EXEC_PATH="@@@EXEC_PATH@@@"
START_SHELL_PATH="/opt/deepinwine/tools/run_v4.sh" START_SHELL_PATH="{['/opt/deepinwine/tools/run_v4.sh', '/opt/deepinwine/tools/spark_run_v4.sh'][chooseWineHelperValue.isChecked()]}"
export MIME_TYPE="" export MIME_TYPE=""
export MIME_EXEC="" export MIME_EXEC=""
export DEB_PACKAGE_NAME="{e1_text.text()}" export DEB_PACKAGE_NAME="{e1_text.text()}"
@ -1391,7 +1393,7 @@ def ChangeArchCombobox():
option = True option = True
if debArch.currentIndex() != 0: if debArch.currentIndex() != 0:
option = False option = False
chooseWineHelperValue.setEnabled(option) #chooseWineHelperValue.setEnabled(option)
wineVersion.setEnabled(option) wineVersion.setEnabled(option)
useInstallWineArch.setEnabled(option) useInstallWineArch.setEnabled(option)
#rmBash.setEnabled(option) #rmBash.setEnabled(option)

0
docker.txt Normal file
View File

View File

@ -170,9 +170,9 @@ class Runexebutton_threading(QtCore.QThread):
else: else:
option += "WINEDEBUG=FIXME,ERR,WARN,TRACE,Message " option += "WINEDEBUG=FIXME,ERR,WARN,TRACE,Message "
wineUsingOption = "" wineUsingOption = ""
if o1.currentText() == "基于 exagear 的 deepin-wine6-stable" or o1.currentText() == "基于 UOS box86 的 deepin-wine6-stable": if o1.currentText() == "基于 UOS exagear 的 deepin-wine6-stable" or o1.currentText() == "基于 UOS box86 的 deepin-wine6-stable":
wineUsingOption = "" wineUsingOption = ""
if o1.currentText() == "基于 UOS box86 的 deepin-wine6-stable" or o1.currentText() == "基于 exagear 的 deepin-wine6-stable": if o1.currentText() == "基于 UOS box86 的 deepin-wine6-stable" or o1.currentText() == "基于 UOS exagear 的 deepin-wine6-stable":
if not os.path.exists(f"{programPath}/dlls-arm"): if not os.path.exists(f"{programPath}/dlls-arm"):
if os.system(f"7z x -y \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""): if os.system(f"7z x -y \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""):
QtWidgets.QMessageBox.critical(widget, "错误", "无法解压资源") QtWidgets.QMessageBox.critical(widget, "错误", "无法解压资源")
@ -316,13 +316,13 @@ def make_desktop_on_launcher():
else: else:
option += "WINEDEBUG=FIXME,ERR,WARN,TRACE,Message " option += "WINEDEBUG=FIXME,ERR,WARN,TRACE,Message "
wineUsingOption = "" wineUsingOption = ""
if o1.currentText() == "基于 UOS box86 的 deepin-wine6-stable" or o1.currentText() == "基于 exagear 的 deepin-wine6-stable": if o1.currentText() == "基于 UOS box86 的 deepin-wine6-stable" or o1.currentText() == "基于 UOS exagear 的 deepin-wine6-stable":
if not os.path.exists(f"{programPath}/dlls-arm"): if not os.path.exists(f"{programPath}/dlls-arm"):
if os.system(f"7z x -y \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""): if os.system(f"7z x -y \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""):
QtWidgets.QMessageBox.critical(widget, "错误", "无法解压资源") QtWidgets.QMessageBox.critical(widget, "错误", "无法解压资源")
return return
os.remove(f"{programPath}/dlls-arm.7z") os.remove(f"{programPath}/dlls-arm.7z")
if o1.currentText() == "基于 exagear 的 deepin-wine6-stable" or o1.currentText() == "基于 UOS box86 的 deepin-wine6-stable": if o1.currentText() == "基于 UOS exagear 的 deepin-wine6-stable" or o1.currentText() == "基于 UOS box86 的 deepin-wine6-stable":
wineUsingOption = "" wineUsingOption = ""
value = "" value = ""
if e2.currentText()[:2].upper() == "C:": if e2.currentText()[:2].upper() == "C:":
@ -376,9 +376,9 @@ def make_desktop_on_desktop():
else: else:
wineBottonPath = e1.currentText() wineBottonPath = e1.currentText()
wineUsingOption = "" wineUsingOption = ""
if o1.currentText() == "基于 exagear 的 deepin-wine6-stable" or o1.currentText() == "基于 UOS box86 的 deepin-wine6-stable": if o1.currentText() == "基于 UOS exagear 的 deepin-wine6-stable" or o1.currentText() == "基于 UOS box86 的 deepin-wine6-stable":
wineUsingOption = "" wineUsingOption = ""
if o1.currentText() == "基于 UOS box86 的 deepin-wine6-stable" or o1.currentText() == "基于 exagear 的 deepin-wine6-stable": if o1.currentText() == "基于 UOS box86 的 deepin-wine6-stable" or o1.currentText() == "基于 UOS exagear 的 deepin-wine6-stable":
if not os.path.exists(f"{programPath}/dlls-arm"): if not os.path.exists(f"{programPath}/dlls-arm"):
if os.system(f"7z x -y \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""): if os.system(f"7z x -y \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""):
QtWidgets.QMessageBox.critical(widget, "错误", "无法解压资源") QtWidgets.QMessageBox.critical(widget, "错误", "无法解压资源")
@ -509,11 +509,11 @@ class RunWineProgramThread(QtCore.QThread):
if not setting["Debug"]: if not setting["Debug"]:
option += "WINEDEBUG=-all " option += "WINEDEBUG=-all "
wineUsingOption = "" wineUsingOption = ""
if o1.currentText() == "基于 exagear 的 deepin-wine6-stable": if o1.currentText() == "基于 UOS exagear 的 deepin-wine6-stable":
os.system(f"'{programPath}/deepin-wine-runner-create-botton.py' '{wineBottonPath}'") os.system(f"'{programPath}/deepin-wine-runner-create-botton.py' '{wineBottonPath}'")
if o1.currentText() == "基于 exagear 的 deepin-wine6-stable" or o1.currentText() == "基于 UOS box86 的 deepin-wine6-stable": if o1.currentText() == "基于 UOS exagear 的 deepin-wine6-stable" or o1.currentText() == "基于 UOS box86 的 deepin-wine6-stable":
wineUsingOption = "" wineUsingOption = ""
if o1.currentText() == "基于 UOS box86 的 deepin-wine6-stable" or o1.currentText() == "基于 exagear 的 deepin-wine6-stable": if o1.currentText() == "基于 UOS box86 的 deepin-wine6-stable" or o1.currentText() == "基于 UOS exagear 的 deepin-wine6-stable":
if not os.path.exists(f"{programPath}/dlls-arm"): if not os.path.exists(f"{programPath}/dlls-arm"):
if os.system(f"7z x -y \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""): if os.system(f"7z x -y \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""):
QtWidgets.QMessageBox.critical(widget, "错误", "无法解压资源") QtWidgets.QMessageBox.critical(widget, "错误", "无法解压资源")
@ -550,7 +550,7 @@ runProgram = None
def RunWineProgram(wineProgram, history = False, Disbled = True): def RunWineProgram(wineProgram, history = False, Disbled = True):
global runProgram global runProgram
DisableButton(True) DisableButton(True)
if not CheckProgramIsInstall(wine[o1.currentText()]) and o1.currentText() != "基于 linglong 的 deepin-wine6-stable不推荐" and o1.currentText() != "基于 exagear 的 deepin-wine6-stable" and o1.currentText() != "基于 UOS box86 的 deepin-wine6-stable": if not CheckProgramIsInstall(wine[o1.currentText()]) and o1.currentText() != "基于 linglong 的 deepin-wine6-stable不推荐" and o1.currentText() != "基于 UOS exagear 的 deepin-wine6-stable" and o1.currentText() != "基于 UOS box86 的 deepin-wine6-stable":
if not CheckProgramIsInstall(wine[o1.currentText()]) and not o1.currentText() in untipsWine: if not CheckProgramIsInstall(wine[o1.currentText()]) and not o1.currentText() in untipsWine:
DisableButton(False) DisableButton(False)
return return
@ -575,9 +575,9 @@ class RunWinetricksThread(QtCore.QThread):
if not setting["Debug"]: if not setting["Debug"]:
option += "WINEDEBUG=-all " option += "WINEDEBUG=-all "
wineUsingOption = "" wineUsingOption = ""
if o1.currentText() == "基于 exagear 的 deepin-wine6-stable" or o1.currentText() == "基于 UOS box86 的 deepin-wine6-stable": if o1.currentText() == "基于 UOS exagear 的 deepin-wine6-stable" or o1.currentText() == "基于 UOS box86 的 deepin-wine6-stable":
wineUsingOption = "" wineUsingOption = ""
if o1.currentText() == "基于 UOS box86 的 deepin-wine6-stable" or o1.currentText() == "基于 exagear 的 deepin-wine6-stable": if o1.currentText() == "基于 UOS box86 的 deepin-wine6-stable" or o1.currentText() == "基于 UOS exagear 的 deepin-wine6-stable":
if not os.path.exists(f"{programPath}/dlls-arm"): if not os.path.exists(f"{programPath}/dlls-arm"):
if os.system(f"7z x -y \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""): if os.system(f"7z x -y \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""):
QtWidgets.QMessageBox.critical(widget, "错误", "无法解压资源") QtWidgets.QMessageBox.critical(widget, "错误", "无法解压资源")
@ -606,11 +606,11 @@ runWinetricks = None
def RunWinetricks(): def RunWinetricks():
global runWinetricks global runWinetricks
DisableButton(True) DisableButton(True)
if not CheckProgramIsInstall(wine[o1.currentText()]) and o1.currentText() != "基于 linglong 的 deepin-wine6-stable不推荐" and o1.currentText() != "基于 exagear 的 deepin-wine6-stable" and o1.currentText() != "基于 UOS box86 的 deepin-wine6-stable": if not CheckProgramIsInstall(wine[o1.currentText()]) and o1.currentText() != "基于 linglong 的 deepin-wine6-stable不推荐" and o1.currentText() != "基于 UOS exagear 的 deepin-wine6-stable" and o1.currentText() != "基于 UOS box86 的 deepin-wine6-stable":
if not CheckProgramIsInstall(wine[o1.currentText()]) and not o1.currentText() in untipsWine: if not CheckProgramIsInstall(wine[o1.currentText()]) and not o1.currentText() in untipsWine:
DisableButton(False) DisableButton(False)
return return
if o1.currentText() == "基于 UOS box86 的 deepin-wine6-stable" or o1.currentText() == "基于 exagear 的 deepin-wine6-stable": if o1.currentText() == "基于 UOS box86 的 deepin-wine6-stable" or o1.currentText() == "基于 UOS exagear 的 deepin-wine6-stable":
if not os.path.exists(f"{programPath}/dlls-arm"): if not os.path.exists(f"{programPath}/dlls-arm"):
if os.system(f"7z x -y \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""): if os.system(f"7z x -y \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""):
QtWidgets.QMessageBox.critical(widget, "错误", "无法解压资源") QtWidgets.QMessageBox.critical(widget, "错误", "无法解压资源")
@ -1667,11 +1667,14 @@ if not os.path.exists(get_home() + "/.config/deepin-wine-runner/WineSetting.json
# 设置变量 # 设置变量
########################### ###########################
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
# 如果要添加其他 wine请在字典添加其名称和执行路径 # 如果要添加其他 wine请使用安装更多 Wine 功能
#############
# 检测 Wine
#############
try: try:
wine = { wine = {
"基于 UOS box86 的 deepin-wine6-stable": f"WINEPREDLL='{programPath}/dlls-arm' WINEDLLPATH=/opt/deepin-wine6-stable/lib BOX86_NOSIGSEGV=1 /opt/deepin-box86/box86 /opt/deepin-wine6-stable/bin/wine ", "基于 UOS box86 的 deepin-wine6-stable": f"WINEPREDLL='{programPath}/dlls-arm' WINEDLLPATH=/opt/deepin-wine6-stable/lib BOX86_NOSIGSEGV=1 /opt/deepin-box86/box86 /opt/deepin-wine6-stable/bin/wine ",
"基于 exagear 的 deepin-wine6-stable": f"WINEPREDLL='{programPath}/dlls-arm' WINEDLLPATH=/opt/deepin-wine6-stable/lib /opt/exagear/bin/ubt_x64a64_al --path-prefix {get_home()}/.deepinwine/debian-buster --utmp-paths-list {get_home()}/.deepinwine/debian-buster/.exagear/utmp-list --vpaths-list {get_home()}/.deepinwine/debian-buster/.exagear/vpaths-list --opaths-list {get_home()}/.deepinwine/debian-buster/.exagear/opaths-list --smo-mode fbase --smo-severity smart --fd-limit 8192 --foreign-ubt-binary /opt/exagear/bin/ubt_x32a64_al -- /opt/deepin-wine6-stable/bin/wine ", "基于 UOS exagear 的 deepin-wine6-stable": f"WINEPREDLL='{programPath}/dlls-arm' WINEDLLPATH=/opt/deepin-wine6-stable/lib /opt/exagear/bin/ubt_x64a64_al --path-prefix {get_home()}/.deepinwine/debian-buster --utmp-paths-list {get_home()}/.deepinwine/debian-buster/.exagear/utmp-list --vpaths-list {get_home()}/.deepinwine/debian-buster/.exagear/vpaths-list --opaths-list {get_home()}/.deepinwine/debian-buster/.exagear/opaths-list --smo-mode fbase --smo-severity smart --fd-limit 8192 --foreign-ubt-binary /opt/exagear/bin/ubt_x32a64_al -- /opt/deepin-wine6-stable/bin/wine ",
"deepin-wine6 stable": "deepin-wine6-stable", "deepin-wine6 stable": "deepin-wine6-stable",
"deepin-wine5 stable": "deepin-wine5-stable", "deepin-wine5 stable": "deepin-wine5-stable",
"spark-wine7-devel": "spark-wine7-devel", "spark-wine7-devel": "spark-wine7-devel",
@ -1683,11 +1686,13 @@ try:
"mono这不是 wine但可以实现初步调用运行 .net 应用)": "mono", "mono这不是 wine但可以实现初步调用运行 .net 应用)": "mono",
"基于 linglong 的 deepin-wine6-stable不推荐": f"ll-cli run '' --exec '/bin/deepin-wine6-stable'" "基于 linglong 的 deepin-wine6-stable不推荐": f"ll-cli run '' --exec '/bin/deepin-wine6-stable'"
} }
untipsWine = ["基于 UOS box86 的 deepin-wine6-stable", "基于 exagear 的 deepin-wine6-stable", "基于 linglong 的 deepin-wine6-stable不推荐"] untipsWine = ["基于 exagear 的 deepin-wine6-stable", "基于 UOS box86 的 deepin-wine6-stable", "基于 UOS exagear 的 deepin-wine6-stable", "基于 linglong 的 deepin-wine6-stable不推荐"]
canUseWine = [] canUseWine = []
if os.path.exists("/opt/deepin-box86/box86"): if os.path.exists("/opt/deepin-box86/box86") and os.path.exists("/opt/deepin-wine6-stable/bin/wine"):
canUseWine.append("基于 UOS box86 的 deepin-wine6-stable") canUseWine.append("基于 UOS box86 的 deepin-wine6-stable")
if os.path.exists("/opt/exagear/bin/ubt_x64a64_al"): if os.path.exists("/opt/exagear/bin/ubt_x64a64_al") and os.path.exists("/opt/deepin-wine6-stable/bin/wine"):
canUseWine.append("基于 UOS exagear 的 deepin-wine6-stable")
if not os.system("which exagear") and os.path.exists("/opt/deepin-wine6-stable/bin/wine"):
canUseWine.append("基于 exagear 的 deepin-wine6-stable") canUseWine.append("基于 exagear 的 deepin-wine6-stable")
for i in wine.keys(): for i in wine.keys():
if not os.system(f"which '{wine[i]}'"): if not os.system(f"which '{wine[i]}'"):
@ -1719,8 +1724,11 @@ try:
if os.system("which box64") == 0: if os.system("which box64") == 0:
name = "基于 box64 的 " name = "基于 box64 的 "
value = f"box64 " value = f"box64 "
if os.path.exists("/opt/exagear/bin/ubt_x64a64_al"): if os.system("which exagear") == 0:
name = "基于 exagear 的 " name = "基于 exagear 的 "
value = f"exagear "
if os.path.exists("/opt/exagear/bin/ubt_x64a64_al"):
name = "基于 UOS exagear 的 "
value = f"WINEPREDLL='{programPath}/dlls-arm' WINEDLLPATH=/opt/deepin-wine6-stable/lib /opt/exagear/bin/ubt_x64a64_al --path-prefix {get_home()}/.deepinwine/debian-buster --utmp-paths-list {get_home()}/.deepinwine/debian-buster/.exagear/utmp-list --vpaths-list {get_home()}/.deepinwine/debian-buster/.exagear/vpaths-list --opaths-list {get_home()}/.deepinwine/debian-buster/.exagear/opaths-list --smo-mode fbase --smo-severity smart --fd-limit 8192 --foreign-ubt-binary /opt/exagear/bin/ubt_x32a64_al -- " value = f"WINEPREDLL='{programPath}/dlls-arm' WINEDLLPATH=/opt/deepin-wine6-stable/lib /opt/exagear/bin/ubt_x64a64_al --path-prefix {get_home()}/.deepinwine/debian-buster --utmp-paths-list {get_home()}/.deepinwine/debian-buster/.exagear/utmp-list --vpaths-list {get_home()}/.deepinwine/debian-buster/.exagear/vpaths-list --opaths-list {get_home()}/.deepinwine/debian-buster/.exagear/opaths-list --smo-mode fbase --smo-severity smart --fd-limit 8192 --foreign-ubt-binary /opt/exagear/bin/ubt_x32a64_al -- "
except: except:
pass pass
@ -1787,6 +1795,18 @@ def getFileFolderSize(fileOrFolderPath):
def get_now_lang()->"获取当前语言": def get_now_lang()->"获取当前语言":
return os.getenv('LANG') return os.getenv('LANG')
# 又需要修复多线程导致的控件问题
def AddDockerMenu():
global dockers
global openFileManager
global openTerminal
dockers = menu.addMenu("该 Docker 基础管理")
openFileManager = QtWidgets.QAction("打开默认文件管理器")
openTerminal = QtWidgets.QAction("打开默认终端")
openFileManager.triggered.connect(lambda: threading.Thread(target=os.system, args=[f"xdg-open '{get_home()}'"]).start())
dockers.addAction(openFileManager)
dockers.addAction(openTerminal)
def GetVersion(): def GetVersion():
global about global about
global programVersionType global programVersionType
@ -1795,53 +1815,65 @@ def GetVersion():
# 商店版本:~uos # 商店版本:~uos
# 编译版本:无版本号 # 编译版本:无版本号
# Gitee/Github……正常版本 # Gitee/Github……正常版本
# Docker 版本
programVersionTypeLnk = { programVersionTypeLnk = {
"spark": "星火应用商店版本", "spark": "星火应用商店版本",
"uos": "deepin/UOS 应用商店版本<带签名>" "uos": "deepin/UOS 应用商店版本<带签名>"
} }
programVersionType = "从源码运行的版本" # 直接判断是不是 Docker 版本
try: if os.path.exists(f"{programPath}/docker.txt"):
if not os.path.exists("/var/lib/dpkg/status"): programVersionType = "Docker 内置版本"
print("无 dpkg结束") window.setWindowTitle(f"{title} Docker 内置版本)")
file = open("/var/lib/dpkg/status", "r") AddDockerMenu()
fileName = file.read().splitlines() else:
package = False programVersionType = "从源码运行的版本"
for i in range(0, len(fileName)): try:
if fileName[i] == "Package: spark-deepin-wine-runner-52": if not os.path.exists("/var/lib/dpkg/status"):
programVersionType = "吾爱专版" print("无 dpkg结束")
window.setWindowTitle(f"{title} 吾爱专版") file = open("/var/lib/dpkg/status", "r")
break fileName = file.read().splitlines()
if fileName[i] == "Package: spark-deepin-wine-runner": package = False
package = True for i in range(0, len(fileName)):
continue if fileName[i] == "Package: spark-deepin-wine-runner-docker":
if not package: programVersionType = "Docker 内置版本"
continue window.setWindowTitle(f"{title} Docker 内置版本)")
if fileName[i].replace(" ", "").replace("\n", "") == "": AddDockerMenu()
# 空行,不再考虑
break
# 搜索版本号
try:
if fileName[i][:fileName[i].index(":")] == "Version":
version = fileName[i][fileName[i].index(":") + 1:].strip()
print(f"版本号为:{version}")
if not "-" in version:
programVersionType = "从Gitee/Github/Gitlink等平台获取的版本"
break
programVersionType = version[version.index("-") + 1:]
print(programVersionType)
if "-" in programVersionType:
# 考虑到如 2.1.0-2-spark 的情况
programVersionType = programVersionType[programVersionType.index("-") + 1:]
try:
programVersionType = programVersionTypeLnk[programVersionType]
except:
programVersionType = "从Gitee/Github/Gitlink等平台获取的版本"
break break
except: if fileName[i] == "Package: spark-deepin-wine-runner-52":
traceback.print_exc() programVersionType = "吾爱专版"
continue window.setWindowTitle(f"{title}(吾爱专版)")
except: break
print("无法读取,当没有处理") if fileName[i] == "Package: spark-deepin-wine-runner":
package = True
continue
if not package:
continue
if fileName[i].replace(" ", "").replace("\n", "") == "":
# 空行,不再考虑
break
# 搜索版本号
try:
if fileName[i][:fileName[i].index(":")] == "Version":
version = fileName[i][fileName[i].index(":") + 1:].strip()
print(f"版本号为:{version}")
if not "-" in version:
programVersionType = "从Gitee/Github/Gitlink等平台获取的版本"
break
programVersionType = version[version.index("-") + 1:]
print(programVersionType)
if "-" in programVersionType:
# 考虑到如 2.1.0-2-spark 的情况
programVersionType = programVersionType[programVersionType.index("-") + 1:]
try:
programVersionType = programVersionTypeLnk[programVersionType]
except:
programVersionType = "从Gitee/Github/Gitlink等平台获取的版本"
break
except:
traceback.print_exc()
continue
except:
print("无法读取,当没有处理")
print(programVersionType) print(programVersionType)
about = about.replace("@VersionForType@", programVersionType) about = about.replace("@VersionForType@", programVersionType)
# 获取程序体积 # 获取程序体积
@ -1886,7 +1918,7 @@ updateThingsString = '''※1、容器自动配置脚本 GUI 查看介绍使用 Q
''' '''
for i in information["Thank"]: for i in information["Thank"]:
thankText += f"{i}\n" thankText += f"{i}\n"
updateTime = "2022年11月15" updateTime = "2022年11月16"
about = f'''<style> about = f'''<style>
a:link, a:active {{ a:link, a:active {{
text-decoration: none; text-decoration: none;
@ -1924,8 +1956,9 @@ Qt 版本:{QtCore.qVersion()}
Deepin 官网https://www.deepin.org Deepin 官网https://www.deepin.org
Deepin 论坛https://bbs.deepin.org</pre> Deepin 论坛https://bbs.deepin.org</pre>
<hr> <hr>
<h1>©2020~{time.strftime("%Y")} <a href="https://gitee.com/gfdgd-xi">gfdgd xi</a><a href="https://weibo.com/u/7755040136">为什么您不喜欢</a><a href="https://gfdgd-xi.github.io">熊出没</a><a href="https://weibo.com/u/7755040136">和阿布呢</a></h1>''' <h1>©2020~{time.strftime("%Y")} gfdgd xi为什么您不喜欢熊出没和阿布呢</h1>'''
title = "Wine 运行器 {}".format(version) title = "Wine 运行器 {}".format(version)
#<h1>©2020~{time.strftime("%Y")} <a href="https://gitee.com/gfdgd-xi">gfdgd xi、</a><a href="https://weibo.com/u/7755040136">为什么您不喜欢</a><a href="https://gfdgd-xi.github.io">熊出没</a><a href="https://weibo.com/u/7755040136">和阿布呢</a></h1>'''
updateThings = "{} 更新内容:\n{}\n更新时间:{}".format(version, updateThingsString, updateTime, time.strftime("%Y")) updateThings = "{} 更新内容:\n{}\n更新时间:{}".format(version, updateThingsString, updateTime, time.strftime("%Y"))
try: try:
threading.Thread(target=requests.get, args=[parse.unquote(base64.b64decode("aHR0cDovLzEyMC4yNS4xNTMuMTQ0L3NwYXJrLWRlZXBpbi13aW5lLXJ1bm5lci9vcGVuL0luc3RhbGwucGhw").decode("utf-8")) + "?Version=" + version]).start() threading.Thread(target=requests.get, args=[parse.unquote(base64.b64decode("aHR0cDovLzEyMC4yNS4xNTMuMTQ0L3NwYXJrLWRlZXBpbi13aW5lLXJ1bm5lci9vcGVuL0luc3RhbGwucGhw").decode("utf-8")) + "?Version=" + version]).start()
@ -1975,8 +2008,6 @@ if not get_now_lang() == "zh_CN.UTF-8":
app.installTranslator(trans) app.installTranslator(trans)
window = QtWidgets.QMainWindow() window = QtWidgets.QMainWindow()
window.setWindowTitle(title) window.setWindowTitle(title)
# 异同步获取信息
threading.Thread(target=GetVersion).start()
widget = QtWidgets.QWidget() widget = QtWidgets.QWidget()
window.setCentralWidget(widget) window.setCentralWidget(widget)
mainLayout = QtWidgets.QGridLayout() mainLayout = QtWidgets.QGridLayout()
@ -2407,7 +2438,8 @@ h6.triggered.connect(WineRunnerBugUpload)
h7.triggered.connect(about_this_program) h7.triggered.connect(about_this_program)
h8.triggered.connect(lambda: QtWidgets.QMessageBox.aboutQt(widget)) h8.triggered.connect(lambda: QtWidgets.QMessageBox.aboutQt(widget))
hm1_1.triggered.connect(lambda: webbrowser.open_new_tab("https://gitee.com/gfdgd-xi/uengine-runner")) hm1_1.triggered.connect(lambda: webbrowser.open_new_tab("https://gitee.com/gfdgd-xi/uengine-runner"))
# 异同步获取信息
threading.Thread(target=GetVersion).start()
# 窗口设置 # 窗口设置
window.resize(widget.frameGeometry().width() * 2, widget.frameGeometry().height()) window.resize(widget.frameGeometry().width() * 2, widget.frameGeometry().height())
widget.setLayout(mainLayout) widget.setLayout(mainLayout)

View File

@ -221,7 +221,8 @@ CallProcess()
debug_log_to_file "Starting process $* ..." debug_log_to_file "Starting process $* ..."
############# WARNING: Here is the modified content: Now will run set-dwine-scale.sh ############# WARNING: Here is the modified content: Now will run set-dwine-scale.sh
/opt/durapps/spark-dwine-helper/scale-set-helper/set-wine-scale.sh "$WINEPREFIX" /opt/durapps/spark-dwine-helper/scale-set-helper/set-wine-scale.sh "$WINEPREFIX"
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$@" & #env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$@" &
env WINEPREFIX="$WINEPREFIX" $EMU_CMD $EMU_ARGS $WINE_CMD "$@" &
#start autobottle #start autobottle
if [ $autostart -eq 0 ];then if [ $autostart -eq 0 ];then