Compare commits

...
2 Commits
Author SHA1 Message Date
gfdgd-xi f1decf51d1 支持导入.7z包时自动移除部分特殊符号
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Waiting to run
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Waiting to run
2024-07-15 21:46:24 +08:00
gfdgd-xi e3c54ffc32 支持手动导入7z包 2024-07-15 20:46:21 +08:00
2 changed files with 21 additions and 10 deletions
+2
View File
@@ -11,6 +11,8 @@ Wine运行器是一个能让Linux用户更加方便地运行Windows应用的程
而且对于部分 Wine 应用适配者来说,提供了图形化的打包工具,以及提供了一些常用工具以及运行库的安装方式,以及能安装多种不同的 Wine 以测试效果,能极大提升适配效率。
且对于 Deepin23 用户做了特别优化,以便能在缺少 i386 运行库的情况下运行 Wine32。同时也为非 X86 架构用户提供了 Box86/64、Qemu User 的安装方式
当前支持 amd64、arm64、mips64el、loong64(新世界)、loongarch64(旧世界)、riscv64
注:
**在使用运行器时不要随便动 .deepinwine 下的容器,否则会导致安装的 wine 应用无法正常打开**
**除非你有把握不会损坏容器**
+19 -10
View File
@@ -112,7 +112,7 @@ class Ui_MainWindow(object):
self.delButton.setText(_translate("MainWindow", ">>"))
self.unzip.setText(_translate("MainWindow", "不解压Wine资源文件"))
self.deleteZip.setText(_translate("MainWindow", "删除下载的资源包,只解压保留(两个选项都选相互抵消)"))
self.addOtherWine.setText(_translate("MainWindow", "导入自己的Wine"))
self.addOtherWine.setText(_translate("MainWindow", "导入 Wine 7z 包"))
self.downloadWineFromCloudDisk.setText(_translate("MainWindow", "从网盘下载 Wine"))
def ReadLocalInformation():
@@ -136,7 +136,7 @@ def ReadLocalInformation():
QtWidgets.QMessageBox.critical(window, "错误", traceback.format_exc())
def InstallOtherWine():
path = QtWidgets.QFileDialog.getOpenFileName(window, "选择 Wine", os.getenv("~"), "wine(wine);;wine64(wine64);;全部文件(*.*)")
path = QtWidgets.QFileDialog.getOpenFileName(window, "选择 Wine 运行器 Wine 7z 包", os.getenv("~"), "Wine 运行器 Wine 7z 包(*.7z);;全部文件(*.*)")
if path[0] == "" or not path[1]:
return
try:
@@ -144,14 +144,23 @@ def InstallOtherWine():
rfile = open(f"{programPath}/winelist.json", "r")
list = json.loads(rfile.read())
rfile.close()
# 创建映射
name = os.path.basename(os.path.dirname(os.path.dirname(path[0])))
if name == "" or name == None:
name = f"useradd-wine-{random.randint(0, 99999)}"
#binPath = os.path.dirname(os.path.dirname(path[0]))
os.makedirs(f"{programPath}/{name}/bin")
if os.system(f"ln -s '{path[0]}' '{programPath}/{name}/bin/wine'") != 0:
QtWidgets.QMessageBox.critical(window, "新建wine映射失败")
name = os.path.splitext(os.path.basename(path[0]))[0]
removeSymbol = ["(", ")", "", "", " ", "!", "@", "#",
"$", "%", "^", "&", "*", "=", "[", "]",
"{", "}", "\\", "/", "|", "?",
"<", ">", "·", "「", ";", ":", "",
"", "《", "》", "", "。", ",", ".",
"`", "~", "", "、"]
for i in removeSymbol:
name.replace(i, "")
unpackPath = f"{programPath}/{name}"
shellCommand = f"""mkdir -p \"{unpackPath}\"
7z x -y \"{path[0]}\" -o\"{unpackPath}\"
"""
shellFile = open("/tmp/depein-wine-runner-wine-install.sh", "w")
shellFile.write(shellCommand)
shellFile.close()
OpenTerminal("bash /tmp/depein-wine-runner-wine-install.sh")
# C++ 版注释:不直接用 readwrite 是因为不能覆盖写入
file = open(f"{programPath}/winelist.json", "w")
list.append(name)