mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-12-14 11:02:04 +08:00
1.9.0大体完成
This commit is contained in:
@@ -22,11 +22,12 @@ def AddSparkStoreSource():
|
||||
os.system("sudo apt update -o Dir::Etc::sourcelist=\"sources.list.d/sparkstore.list\" -o Dir::Etc::sourceparts=\"-\" -o APT::Get::List-Cleanup=\"0\"")
|
||||
|
||||
def InstallSparkWine(wine):
|
||||
if os.path.exists("/usr/local/bin/ss-apt-fast"):
|
||||
os.system("sudo apt install apt-fast -y")
|
||||
os.system(f"sudo ss-apt-fast install \"{wine}\" -y")
|
||||
return
|
||||
os.system(f"sudo apt install \"{wine}\" -y")
|
||||
#if os.path.exists("/usr/local/bin/ss-apt-fast"):
|
||||
#os.system("sudo apt install apt-fast -y")
|
||||
#os.system(f"sudo ss-apt-fast install \"{wine}\" -y")
|
||||
#return
|
||||
os.system("sudo ss-apt-fast update")
|
||||
os.system(f"sudo ss-apt-fast install \"{wine}\" -y")
|
||||
|
||||
###################
|
||||
# 程序功能
|
||||
@@ -47,12 +48,8 @@ print("请问是否要安装 deepin-wine?[Y/N]", end=' ')
|
||||
choose = input().upper()
|
||||
if not choose == "N":
|
||||
os.system("sudo apt install deepin-wine -y")
|
||||
print("请问是否要安装 deepin-wine5(需要添加星火应用商店的源)?[Y/N]", end=' ')
|
||||
print("请问是否要安装 deepin-wine5(需要安装最新版星火应用商店)?[Y/N]", end=' ')
|
||||
choose = input().upper()
|
||||
if not choose == "N":
|
||||
if not os.path.exists("/etc/apt/sources.list.d/sparkstore.list"):
|
||||
AddSparkStoreSource()
|
||||
InstallSparkWine("deepin-wine5")
|
||||
print("请问是否要安装 deepin-wine5-stable?[Y/N]", end=' ')
|
||||
choose = input().upper()
|
||||
if not choose == "N":
|
||||
@@ -61,11 +58,9 @@ print("请问是否要安装 deepin-wine6-stable?[Y/N]", end=' ')
|
||||
choose = input().upper()
|
||||
if not choose == "N":
|
||||
os.system("sudo apt install deepin-wine6-stable -y")
|
||||
print("请问是否要安装 spark-wine7-devel(需要添加星火应用商店的源)?[Y/N]", end=' ')
|
||||
print("请问是否要安装 spark-wine7-devel(需要安装最新版星火应用商店)?[Y/N]", end=' ')
|
||||
choose = input().upper()
|
||||
if not choose == "N":
|
||||
if not os.path.exists("/etc/apt/sources.list.d/sparkstore.list"):
|
||||
AddSparkStoreSource()
|
||||
InstallSparkWine("spark-wine7-devel")
|
||||
print("请问是否要安装 ukylin-wine(需要添加 ukylin 源,但因为可能会导致系统问题,将不会自动添加)?[Y/N]", end=" ")
|
||||
choose = input().upper()
|
||||
|
||||
67
deb/opt/apps/deepin-wine-runner/InstallNewWineHQ.sh
Executable file
67
deb/opt/apps/deepin-wine-runner/InstallNewWineHQ.sh
Executable file
@@ -0,0 +1,67 @@
|
||||
#!/bin/bash
|
||||
ubuntuSource=(
|
||||
"sudo wget -nc -P /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources"
|
||||
"sudo wget -nc -P /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/impish/winehq-impish.sources"
|
||||
"sudo wget -nc -P /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/focal/winehq-focal.sources"
|
||||
"sudo wget -nc -P /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/bionic/winehq-bionic.sources"
|
||||
)
|
||||
debianSource=(
|
||||
"sudo wget -nc -P /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/buster/winehq-buster.sources"
|
||||
"sudo wget -nc -P /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/bullseye/winehq-bullseye.sources"
|
||||
"sudo wget -nc -P /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/bookworm/winehq-bookworm.sources"
|
||||
)
|
||||
# 选择发行版
|
||||
toilet WineHQ
|
||||
echo "WineHQ 官网:https://wiki.winehq.org/"
|
||||
echo
|
||||
echo "选择发行版:"
|
||||
echo "0. Debian"
|
||||
echo "1. Ubuntu"
|
||||
read system
|
||||
# 选择版本
|
||||
echo "选择系统版本"
|
||||
if [ $system = "0" ]; then
|
||||
echo "0. Debian 10 (Buster)"
|
||||
echo "1. Debian 11 (Bullseye)"
|
||||
echo "2. Debian Testing (Bookworm)"
|
||||
fi
|
||||
if [ $system = "1" ]; then
|
||||
echo "0. Ubuntu 22.04"
|
||||
echo "1. Ubuntu 21.10"
|
||||
echo "2. Ubuntu 20.04,Linux Mint 20.x"
|
||||
echo "3. Ubuntu 18.04,Linux Mint 19.x"
|
||||
fi
|
||||
read systemVersion
|
||||
# 选择 Wine
|
||||
echo "选择 Wine:"
|
||||
echo "0. 稳定分支"
|
||||
echo "1. 开发分支"
|
||||
echo "2. Staging 分支"
|
||||
read programVersion
|
||||
# 初步配置
|
||||
sudo apt-key del "D43F 6401 4536 9C51 D786 DDEA 76F1 A20F F987 672F"
|
||||
sudo dpkg --add-architecture i386
|
||||
sudo wget -nc -O /usr/share/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
|
||||
# 检测 apt-fast 或 ss-apt-fast 是否存在
|
||||
apt="apt"
|
||||
which apt-fast > /dev/null
|
||||
if [ $? == 0 ]; then
|
||||
apt="apt-fast"
|
||||
fi
|
||||
which ss-apt-fast > /dev/null
|
||||
if [ $? == 0 ]; then
|
||||
apt="ss-apt-fast"
|
||||
fi
|
||||
# 添加源
|
||||
if [ $system = "0" ]; then
|
||||
${debianSource[$systemVersion]}
|
||||
fi
|
||||
if [ $system = "1" ]; then
|
||||
${ubuntuSource[$systemVersion]}
|
||||
fi
|
||||
sudo $apt update
|
||||
# 安装 Wine
|
||||
wineInstall=("sudo $apt install --install-recommends winehq-stable" "sudo $apt install --install-recommends winehq-devel" "sudo $apt install --install-recommends winehq-staging")
|
||||
${wineInstall[$programVersion]}
|
||||
echo "按回车键退出"
|
||||
read
|
||||
@@ -1,22 +0,0 @@
|
||||
#!/bin/bash
|
||||
# 使用系统默认的 bash 运行
|
||||
###########################################################################################
|
||||
# 作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢
|
||||
# 版本:1.7.0
|
||||
# 更新时间:2022年07月15日
|
||||
# 感谢:感谢 wine 以及 deepin-wine 团队,提供了 wine 和 deepin-wine 给大家使用,让我能做这个程序
|
||||
# 基于 Python3 的 tkinter 构建
|
||||
###########################################################################################
|
||||
VBoxManage showvminfo Windows
|
||||
if test 0 == $?; then
|
||||
# 检测到虚拟机存在,启动虚拟机
|
||||
VBoxManage startvm Windows
|
||||
exit
|
||||
fi
|
||||
zenity --question --no-wrap --text="检查到您未创建所指定的虚拟机,是否创建虚拟机并继续?\n如果不创建将无法使用"
|
||||
if test 1 == $?; then
|
||||
# 用户不想创建虚拟机,结束
|
||||
exit
|
||||
fi
|
||||
cd `dirname $0`
|
||||
./VM/VirtualMachine
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 35 KiB |
85
deb/opt/apps/deepin-wine-runner/clean-unuse-program.py
Executable file
85
deb/opt/apps/deepin-wine-runner/clean-unuse-program.py
Executable file
@@ -0,0 +1,85 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
|
||||
if __name__ == "__main__":
|
||||
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
|
||||
print("此程序可以帮助您删除程序无需的组件以节约空间")
|
||||
print("如果删除后想要恢复这样组件需要重新安装该软件包")
|
||||
delProgramList = []
|
||||
delProramCommand = "#!/bin/bash\n"
|
||||
for i in [
|
||||
[
|
||||
"Wine 打包器(不基于生态打包脚本)",
|
||||
[
|
||||
f"{programPath}/dlls.7z",
|
||||
f"{programPath}/dlls",
|
||||
f"{programPath}/exagear",
|
||||
f"{programPath}/exagear.7z",
|
||||
f"{programPath}/exagear",
|
||||
f"{programPath}/wined3d.dll.so.7z",
|
||||
f"{programPath}/wined3d.dll.so",
|
||||
f"{programPath}/deepin-wine-packager.py",
|
||||
"/usr/bin/deepin-wine-package-builder",
|
||||
"/usr/share/applications/spark-deepin-wine-package-builder.desktop"
|
||||
]
|
||||
],
|
||||
[
|
||||
"Wine 打包器(基于生态打包脚本)",
|
||||
[
|
||||
f"{programPath}/deepin-wine-packager-with-script.py",
|
||||
f"{programPath}/package-script.zip",
|
||||
f"{programPath}/package-script",
|
||||
"/usr/bin/deepin-wine-packager-with-script",
|
||||
"/usr/share/applications/spark-deepin-wine-packager-with-script.desktop"
|
||||
]
|
||||
],
|
||||
[
|
||||
"Arm 64 box86 wine 运行 DLL",
|
||||
[
|
||||
f"{programPath}/dlls-arm.7z",
|
||||
f"{programPath}/dlls-arm"
|
||||
]
|
||||
],
|
||||
[
|
||||
"Windows 虚拟机简易安装组件",
|
||||
[
|
||||
f"{programPath}/StartVM.sh",
|
||||
f"{programPath}/RunVM.sh",
|
||||
f"{programPath}/VM",
|
||||
"/usr/share/applications/spark-deepin-wine-runner-control-vm.desktop",
|
||||
"/usr/share/applications/spark-deepin-wine-runner-start-vm.desktop"
|
||||
]
|
||||
],
|
||||
[
|
||||
"Wine 安装组件",
|
||||
[
|
||||
f"{programPath}/AllInstall.py",
|
||||
f"{programPath}/wine install",
|
||||
f"{programPath}/InstallWineOnDeepin23.py",
|
||||
f"{programPath}/sparkstore.list",
|
||||
f"{programPath}/InstallNewWineHQ.sh",
|
||||
"/usr/bin/deepin-wine-runner-wine-installer",
|
||||
"/usr/bin/deepin-wine-runner-wine-install-deepin23",
|
||||
"/usr/bin/deepin-wine-runner-wine-install",
|
||||
"/usr/bin/deepin-wine-runner-winehq-install"
|
||||
]
|
||||
]
|
||||
]:
|
||||
if not os.path.exists(i[1][0]):
|
||||
continue
|
||||
if input(f"是否删除组件“{i[0]}”?[Y/n]").upper() == "Y":
|
||||
delProgramList.append(i)
|
||||
for x in i[1]:
|
||||
if x == "/*" or x == "/": # 为了防止个人疏忽,出现危险命令,所以如果有最危险的 /* 会直接跳过该命令的写入
|
||||
continue
|
||||
delProramCommand += f"rm -rfv \"{x}\"\n"
|
||||
if len(delProgramList) == 0:
|
||||
print("您已经删除了所有可删除的组件,如果需要使用被删除的组件,请重新安装该软件安装包")
|
||||
input("按回车退出")
|
||||
exit()
|
||||
print("开始删除")
|
||||
file = open("/tmp/deepin-wine-clean.sh", "w")
|
||||
file.write(delProramCommand)
|
||||
file.close()
|
||||
os.system("pkexec bash /tmp/deepin-wine-clean.sh")
|
||||
input("按回车键退出程序")
|
||||
@@ -61,6 +61,9 @@ def disabled_or_NORMAL_all(choose):
|
||||
option1_text.setDisabled(choose)
|
||||
chooseWineHelperValue.setDisabled(choose)
|
||||
wineVersion.setDisabled(choose)
|
||||
debArch.setDisabled(choose)
|
||||
if not choose:
|
||||
ChangeArchCombobox()
|
||||
|
||||
class QT:
|
||||
thread = None
|
||||
@@ -157,82 +160,17 @@ class make_deb_threading(QtCore.QThread):
|
||||
disabled_or_NORMAL_all(True)
|
||||
self.label.emit("容器路径填写错误,无法进行构建 deb 包")
|
||||
return
|
||||
#############
|
||||
# 删除文件
|
||||
#############
|
||||
self.label.emit("正在删除对构建 deb 包有影响的文件……")
|
||||
debPackagePath = f"/tmp/{random.randint(0, 9999)}"
|
||||
self.run_command(f"rm -rfv /tmp/{debPackagePath}")
|
||||
###############
|
||||
# 创建目录
|
||||
###############
|
||||
self.label.emit("正在创建目录……")
|
||||
os.makedirs("{}/DEBIAN".format(debPackagePath))
|
||||
os.makedirs("{}/opt/apps/{}/entries/applications".format(debPackagePath, e1_text.text()))
|
||||
os.makedirs("{}/opt/apps/{}/entries/icons/hicolor/scalable/apps".format(debPackagePath, e1_text.text()))
|
||||
os.makedirs("{}/opt/apps/{}/files".format(debPackagePath, e1_text.text()))
|
||||
###############
|
||||
# 创建文件
|
||||
###############
|
||||
self.label.emit("正在创建文件……")
|
||||
os.mknod("{}/DEBIAN/control".format(debPackagePath))
|
||||
os.mknod("{}/opt/apps/{}/entries/applications/{}.desktop".format(debPackagePath, e1_text.text(), e1_text.text()))
|
||||
os.mknod("{}/opt/apps/{}/files/run.sh".format(debPackagePath, e1_text.text()))
|
||||
os.mknod("{}/opt/apps/{}/info".format(debPackagePath, e1_text.text()))
|
||||
###############
|
||||
# 设置容器
|
||||
###############
|
||||
self.label.emit("正在设置 wine 容器")
|
||||
os.chdir(b)
|
||||
self.run_command("sed -i \"s#$USER#@current_user@#\" ./*.reg")
|
||||
os.chdir(f"{b}/drive_c/users")
|
||||
self.run_command(f"mv -v '{os.getlogin()}' @current_user@")
|
||||
os.chdir(programPath)
|
||||
###############
|
||||
# 压缩容器
|
||||
###############
|
||||
self.label.emit("正在打包 wine 容器")
|
||||
self.run_command("7z a {}/opt/apps/{}/files/files.7z {}/*".format(debPackagePath, e1_text.text(), b))
|
||||
###############
|
||||
# 复制图片
|
||||
###############
|
||||
self.label.emit("正在复制文件……")
|
||||
self.run_command(f"cp -rv '{programPath}/dlls' {debPackagePath}/opt/apps/{e1_text.text()}/files/")
|
||||
if e9_text.text() != "":
|
||||
shutil.copy(e9_text.text(), "{}/opt/apps/{}/entries/icons/hicolor/scalable/apps/{}.{}".format(debPackagePath, e1_text.text(), e1_text.text(), imms))
|
||||
################
|
||||
# 获取文件大小
|
||||
################
|
||||
self.label.emit("正在计算文件大小……")
|
||||
size = getFileFolderSize(debPackagePath) / 1024
|
||||
################
|
||||
# 写入文本文档
|
||||
################
|
||||
self.label.emit("正在写入文件……")
|
||||
if not chooseWineHelperValue.isChecked():
|
||||
write_txt("{}/DEBIAN/control".format(debPackagePath), '''Package: {}
|
||||
Version: {}
|
||||
Architecture: i386
|
||||
Maintainer: {}
|
||||
Depends: {}, deepin-wine-helper (>= 5.1.30-1), fonts-wqy-microhei, fonts-wqy-zenhei
|
||||
Section: non-free/otherosfs
|
||||
Priority: optional
|
||||
Multi-Arch: foreign
|
||||
Description: {}
|
||||
'''.format(e1_text.text(), e2_text.text(), e4_text.text(), wine[wineVersion.currentText()], e3_text.text()))
|
||||
else:
|
||||
write_txt("{}/DEBIAN/control".format(debPackagePath), '''Package: {}
|
||||
Version: {}
|
||||
Architecture: i386
|
||||
Maintainer: {}
|
||||
Depends: {}, spark-dwine-helper (>= 1.6.2), fonts-wqy-microhei, fonts-wqy-zenhei
|
||||
Section: non-free/otherosfs
|
||||
Priority: optional
|
||||
Multi-Arch: foreign
|
||||
Description: {}
|
||||
'''.format(e1_text.text(), e2_text.text(), e4_text.text(), wine[wineVersion.currentText()], e3_text.text()))
|
||||
if rmBash.isChecked():
|
||||
write_txt("{}/DEBIAN/postrm".format(debPackagePath, e1_text.text()), f'''#!/bin/bash
|
||||
debInformation = [
|
||||
{
|
||||
# I386 wine 打包配置文件
|
||||
"Wine": wine[wineVersion.currentText()],
|
||||
"Architecture": "i386",
|
||||
"Depends": [
|
||||
f"{wine[wineVersion.currentText()]}, deepin-wine-helper (>= 5.1.30-1), fonts-wqy-microhei, fonts-wqy-zenhei",
|
||||
f"{wine[wineVersion.currentText()]}, spark-dwine-helper (>= 1.6.2), fonts-wqy-microhei, fonts-wqy-zenhei"
|
||||
][int(chooseWineHelperValue.isChecked())],
|
||||
"postinst": "",
|
||||
"postrm": ["", f"""#!/bin/bash
|
||||
|
||||
if [ "$1" = "remove" ] || [ "$1" = "purge" ];then
|
||||
|
||||
@@ -247,11 +185,9 @@ fi
|
||||
done
|
||||
else
|
||||
echo"非卸载,跳过清理"
|
||||
fi
|
||||
''')
|
||||
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" {}\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()))
|
||||
if not bool(chooseWineHelperValue.text()):
|
||||
write_txt("{}/opt/apps/{}/files/run.sh".format(debPackagePath, e1_text.text()), '''#!/bin/sh
|
||||
fi"""][int()],
|
||||
"run.sh": [
|
||||
f"""#!/bin/sh
|
||||
|
||||
# Copyright (C) 2016 Deepin, Inc.
|
||||
#
|
||||
@@ -260,13 +196,13 @@ fi
|
||||
|
||||
version_gt() {{ test "$(echo "$@" | tr " " "\\n" | sort -V | head -n 1)" != "$1"; }}
|
||||
|
||||
BOTTLENAME="{}"
|
||||
APPVER="{}"
|
||||
EXEC_PATH="{}"
|
||||
BOTTLENAME="{e5_text.text()}"
|
||||
APPVER="{e2_text.text()}"
|
||||
EXEC_PATH="{e7_text.text()}"
|
||||
START_SHELL_PATH="/opt/deepinwine/tools/run_v4.sh"
|
||||
export MIME_TYPE=""
|
||||
export DEB_PACKAGE_NAME="{}"
|
||||
export APPRUN_CMD="{}"
|
||||
export DEB_PACKAGE_NAME="{e1_text.text()}"
|
||||
export APPRUN_CMD="{wine[wineVersion.currentText()]}"
|
||||
DISABLE_ATTACH_FILE_DIALOG=""
|
||||
EXPORT_ENVS=""
|
||||
|
||||
@@ -294,10 +230,8 @@ if [ -n "$EXEC_PATH" ];then
|
||||
fi
|
||||
else
|
||||
$START_SHELL_PATH $BOTTLENAME $APPVER "uninstaller.exe" "$@"
|
||||
fi
|
||||
'''.format(e5_text.text(), e2_text.text(), e7_text.text(), e1_text.text(), wine[wineVersion.currentText()]))
|
||||
else:
|
||||
write_txt("{}/opt/apps/{}/files/run.sh".format(debPackagePath, e1_text.text()), '''#!/bin/sh
|
||||
fi""",
|
||||
f"""#!/bin/sh
|
||||
|
||||
# Copyright (C) 2016 Deepin, Inc.
|
||||
#
|
||||
@@ -333,16 +267,16 @@ Get_Dist_Name()
|
||||
|
||||
version_gt() {{ test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; }}
|
||||
####用于比较版本?未实装
|
||||
BOTTLENAME="{}"
|
||||
APPVER="{}"
|
||||
EXEC_PATH="{}"
|
||||
BOTTLENAME="{e5_text.text()}"
|
||||
APPVER="{e2_text.text()}"
|
||||
EXEC_PATH="{e7_text.text()}"
|
||||
##### 软件在wine中的启动路径
|
||||
START_SHELL_PATH="/opt/deepinwine/tools/spark_run_v4.sh"
|
||||
export MIME_TYPE=""
|
||||
#####没什么用
|
||||
export DEB_PACKAGE_NAME="{}"
|
||||
export DEB_PACKAGE_NAME="{e1_text.text()}"
|
||||
####这里写包名才能在启动的时候正确找到files.7z,似乎也和杀残留进程有关
|
||||
export APPRUN_CMD="{}"
|
||||
export APPRUN_CMD="{wine[wineVersion.currentText()]}"
|
||||
#####wine启动指令,建议
|
||||
EXPORT_ENVS=""
|
||||
|
||||
@@ -403,15 +337,412 @@ if [ -n "$EXEC_PATH" ];then
|
||||
fi
|
||||
else
|
||||
$START_SHELL_PATH $BOTTLENAME $APPVER "uninstaller.exe" "$@"
|
||||
fi"""
|
||||
][chooseWineHelperValue.isChecked()],
|
||||
"info": f'''{{
|
||||
"appid": "{e1_text.text()}",
|
||||
"name": "{e8_text.text()}",
|
||||
"version": "{e2_text.text()}",
|
||||
"arch": ["i386"],
|
||||
"permissions": {{
|
||||
"autostart": false,
|
||||
"notification": false,
|
||||
"trayicon": true,
|
||||
"clipboard": true,
|
||||
"account": false,
|
||||
"bluetooth": false,
|
||||
"camera": true,
|
||||
"audio_record": true,
|
||||
"installed_apps": false
|
||||
}}
|
||||
}}'''
|
||||
},
|
||||
{
|
||||
# ARM64 BOX86 wine 打包配置文件
|
||||
"Wine": f"WINEPREDLL='{programPath}/dlls-arm' WINEDLLPATH=/opt/deepin-wine6-stable/lib BOX86_NOSIGSEGV=1 /opt/deepin-box86/box86 /opt/deepin-wine6-stable/bin/wine ",
|
||||
"Architecture": "arm64",
|
||||
"Depends": "deepin-elf-verify (>= 0.0.16.7-1), com.deepin-wine6-stable.deepin(>=6.0deepin14), com.deepin-box86.deepin(>=0.2.3deepin8), p7zip-full, fonts-wqy-microhei, fonts-noto-cjk",
|
||||
"postinst": f"""#!/bin/sh
|
||||
DEB_PATH=/opt/apps/{e1_text.text()}
|
||||
NVIDIA_DISP_CARD=`lspci | grep VGA | grep NVIDIA`
|
||||
if [ -f $DEB_PATH/files/wined3d.dll.so ] && [ ! -z "$NVIDIA_DISP_CARD" ];then
|
||||
mv $DEB_PATH/files/wined3d.dll.so $DEB_PATH/files/dlls
|
||||
fi
|
||||
'''.format(e5_text.text(), e2_text.text(), e7_text.text(), e1_text.text(), wine[wineVersion.currentText()]))
|
||||
write_txt("{}/opt/apps/{}/info".format(debPackagePath, e1_text.text()), '{\n "appid": "' + e1_text.text() + '",\n "name": "' + e8_text.text() + '",\n "version": "' + e2_text.text() + '",\n "arch": ["i386"],\n "permissions": {\n "autostart": false,\n "notification": false,\n "trayicon": true,\n "clipboard": true,\n "account": false,\n "bluetooth": false,\n "camera": false,\n "audio_record": false,\n "installed_apps": false\n }\n}')
|
||||
true
|
||||
""",
|
||||
"postrm": f"""#!/bin/sh
|
||||
|
||||
BOTTLE="$HOME/.deepinwine/{e5_text.text()}"
|
||||
WINESERVER=/opt/deepin-wine6-stable/bin/wineserver
|
||||
|
||||
if [ -d "$BOTTLE" ];then
|
||||
WINEPREFIX=$BOTTLE $WINESERVER -k
|
||||
rm $BOTTLE -rf
|
||||
fi
|
||||
|
||||
true""",
|
||||
"run.sh": f"""#!/bin/bash
|
||||
DEB_PATH="/opt/apps/{e1_text.text()}"
|
||||
WINE="/opt/deepin-wine6-stable/bin/wine"
|
||||
WINESERVER="/opt/deepin-wine6-stable/bin/wineserver"
|
||||
BOX86="/opt/deepin-box86/box86"
|
||||
EXE="{e7_text.text()}"
|
||||
NEW_VERSION="{e2_text.text()}"
|
||||
BOTTLE="$HOME/.deepinwine/{e5_text.text()}"
|
||||
|
||||
reconstruct_bottle_symlink() {{
|
||||
|
||||
if [ -L $BOTTLE/drive_c/users/$USER/Desktop ]; then
|
||||
rm -f $BOTTLE/drive_c/users/$USER/Desktop
|
||||
ln -s $HOME/Desktop $BOTTLE/drive_c/users/$USER/Desktop
|
||||
fi
|
||||
if [ -L $BOTTLE/drive_c/users/$USER/Documents ]; then
|
||||
rm -f $BOTTLE/drive_c/users/$USER/Documents
|
||||
ln -s $HOME/Documents $BOTTLE/drive_c/users/$USER/Documents
|
||||
fi
|
||||
if [ -L $BOTTLE/drive_c/users/$USER/Downloads ]; then
|
||||
rm -f $BOTTLE/drive_c/users/$USER/Downloads
|
||||
ln -s $HOME/Downloads $BOTTLE/drive_c/users/$USER/Downloads
|
||||
fi
|
||||
|
||||
if [ -L "$BOTTLE/drive_c/users/$USER/My Documents" ]; then
|
||||
rm -f "$BOTTLE/drive_c/users/$USER/My Documents"
|
||||
ln -s $HOME/Documents "$BOTTLE/drive_c/users/$USER/My Documents"
|
||||
fi
|
||||
|
||||
if [ -L "$BOTTLE/drive_c/users/$USER/My Music" ]; then
|
||||
rm -f "$BOTTLE/drive_c/users/$USER/My Music"
|
||||
ln -s $HOME/Music "$BOTTLE/drive_c/users/$USER/My Music"
|
||||
fi
|
||||
if [ -L "$BOTTLE/drive_c/users/$USER/My Videos" ]; then
|
||||
rm -f "$BOTTLE/drive_c/users/$USER/My Videos"
|
||||
ln -s $HOME/Videos "$BOTTLE/drive_c/users/$USER/My Videos"
|
||||
fi
|
||||
}}
|
||||
|
||||
if [ ! -d "$HOME/.deepinwine" ];then
|
||||
mkdir -p "$HOME/.deepinwine"
|
||||
fi
|
||||
|
||||
if [ -f $BOTTLE/VERSION ];then
|
||||
old_version=""
|
||||
while read line; do
|
||||
old_version=$line
|
||||
done < $BOTTLE/VERSION
|
||||
if [ "$old_version" != "$NEW_VERSION" ];then
|
||||
WINEPREFIX=$BOTTLE $BOX86 $WINESERVER -k
|
||||
rm -rf $BOTTLE
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -d $BOTTLE ] && [ ! -f $BOTTLE/VERSION ];then
|
||||
WINEPREFIX=$BOTTLE $BOX86 $WINESERVER -k
|
||||
rm -rf $BOTTLE
|
||||
fi
|
||||
|
||||
if [ ! -d $BOTTLE ];then
|
||||
7z x "$DEB_PATH/files/files.7z" -o"$BOTTLE" -aoa
|
||||
mv "$BOTTLE/drive_c/users/@current_user@" "$BOTTLE/drive_c/users/$USER"
|
||||
sed -i "s#@current_user@#$USER#" $BOTTLE/*.reg
|
||||
reconstruct_bottle_symlink
|
||||
echo $NEW_VERSION > $BOTTLE/VERSION
|
||||
fi
|
||||
|
||||
export WINEPREDLL=$DEB_PATH/files/dlls
|
||||
export ATTACH_FILE_DIALOG=1
|
||||
export WINEDLLPATH=/opt/deepin-wine6-stable/lib
|
||||
WINEPREFIX=$BOTTLE $BOX86 $WINE "$EXE" &""",
|
||||
"info": f'''{{
|
||||
"appid": "{e1_text.text()}",
|
||||
"name": "{e8_text.text()}",
|
||||
"version": "{e2_text.text()}",
|
||||
"arch": ["arm64"],
|
||||
"permissions": {{
|
||||
"autostart": false,
|
||||
"notification": false,
|
||||
"trayicon": true,
|
||||
"clipboard": true,
|
||||
"account": false,
|
||||
"bluetooth": false,
|
||||
"camera": true,
|
||||
"audio_record": true,
|
||||
"installed_apps": false
|
||||
}}
|
||||
}}'''
|
||||
},
|
||||
{
|
||||
# ARM64 exagear wine 打包配置文件
|
||||
"Wine": f"/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 ",
|
||||
"Architecture": "arm64",
|
||||
"Depends": "zenity, com.deepin-wine6-stable.deepin(>=6.0deepin14), deepin-wine-exagear-images(>=10deepin4), com.deepin-box86.deepin(>=0.2.3deepin9), p7zip-full, fonts-wqy-microhei, fonts-noto-cjk",
|
||||
"postinst": "",
|
||||
"postrm": "",
|
||||
"run.sh": f"""#!/bin/bash
|
||||
DEB_PATH="/opt/apps/{e1_text.text()}"
|
||||
WINE="/opt/deepin-wine6-stable/bin/wine"
|
||||
WINESERVER="/opt/deepin-wine6-stable/bin/wineserver"
|
||||
EMU="/opt/exagear/bin/ubt_x64a64_al"
|
||||
IMAGE_PATH=$HOME/.deepinwine/debian-buster
|
||||
EMU_ARGS="--path-prefix $IMAGE_PATH --utmp-paths-list $IMAGE_PATH/.exagear/utmp-list --vpaths-list $IMAGE_PATH/.exagear/vpaths-list --opaths-list $IMAGE_PATH/.exagear/opaths-list --smo-mode fbase --smo-severity smart --fd-limit 8192 --foreign-ubt-binary /opt/exagear/bin/ubt_x32a64_al -- "
|
||||
EXE="{e7_text.text()}"
|
||||
NEW_VERSION="6.4.1deepin1"
|
||||
BOTTLE="$HOME/.deepinwine/{e5_text.text()}"
|
||||
KUNPENG=`lscpu | grep 'Model name' | grep Kunpeng`
|
||||
IMG_ARCHIVE_DIR=/opt/deepin-wine-exagear-images/debian-buster
|
||||
IMAGE_VER="{e2_text.text()}"
|
||||
LOCALTIME=`readlink -f /etc/localtime`
|
||||
|
||||
export LC_ALL=$LANG
|
||||
export XMODIFIERS=$XMODIFIERS
|
||||
export DESKTOP_SESSION=deepin
|
||||
|
||||
if command -v zenity >/dev/null 2>&1; then
|
||||
progressbar()
|
||||
{{
|
||||
WINDOWID="" zenity --progress --title="$1" --text="$2" --pulsate --width=400 --auto-close --no-cancel ||
|
||||
WINDOWID="" zenity --progress --title="$1" --text="$2" --pulsate --width=400 --auto-close
|
||||
}}
|
||||
|
||||
else
|
||||
progressbar()
|
||||
{{
|
||||
cat -
|
||||
}}
|
||||
fi
|
||||
|
||||
reconstruct_bottle_symlink() {{
|
||||
|
||||
if [ -L $BOTTLE/drive_c/users/$USER/Desktop ]; then
|
||||
rm -f $BOTTLE/drive_c/users/$USER/Desktop
|
||||
ln -s $HOME/Desktop $BOTTLE/drive_c/users/$USER/Desktop
|
||||
fi
|
||||
if [ -L $BOTTLE/drive_c/users/$USER/Documents ]; then
|
||||
rm -f $BOTTLE/drive_c/users/$USER/Documents
|
||||
ln -s $HOME/Documents $BOTTLE/drive_c/users/$USER/Documents
|
||||
fi
|
||||
if [ -L $BOTTLE/drive_c/users/$USER/Downloads ]; then
|
||||
rm -f $BOTTLE/drive_c/users/$USER/Downloads
|
||||
ln -s $HOME/Downloads $BOTTLE/drive_c/users/$USER/Downloads
|
||||
fi
|
||||
|
||||
if [ -L "$BOTTLE/drive_c/users/$USER/My Documents" ]; then
|
||||
rm -f "$BOTTLE/drive_c/users/$USER/My Documents"
|
||||
ln -s $HOME/Documents "$BOTTLE/drive_c/users/$USER/My Documents"
|
||||
fi
|
||||
|
||||
if [ -L "$BOTTLE/drive_c/users/$USER/My Music" ]; then
|
||||
rm -f "$BOTTLE/drive_c/users/$USER/My Music"
|
||||
ln -s $HOME/Music "$BOTTLE/drive_c/users/$USER/My Music"
|
||||
fi
|
||||
if [ -L "$BOTTLE/drive_c/users/$USER/My Videos" ]; then
|
||||
rm -f "$BOTTLE/drive_c/users/$USER/My Videos"
|
||||
ln -s $HOME/Videos "$BOTTLE/drive_c/users/$USER/My Videos"
|
||||
fi
|
||||
}}
|
||||
|
||||
extract_image() {{
|
||||
|
||||
progpid=$(ps -ef | grep "zenity --progress --title=${{BOTTLE}}" | grep -v grep)
|
||||
if [ -n "$progpid" ];then
|
||||
echo "one $BOTTLE app is extracting runtime images too."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
7z x "$IMG_ARCHIVE_DIR/files.7z" -o"$IMAGE_PATH" -aoa | progressbar "$BOTTLE" "正在释放环境..."
|
||||
cp /usr/bin/dde-file-manager $IMAGE_PATH/usr/bin/dde-file-manager
|
||||
rm $IMAGE_PATH/etc/localtime
|
||||
ln -s $LOCALTIME $IMAGE_PATH/etc/localtime
|
||||
if [ -d $IMAGE_PATH/etc/resolvconf ];then
|
||||
rm $IMAGE_PATH/etc/resolvconf
|
||||
fi
|
||||
if [ -d /etc/resolvconf ];then
|
||||
cp /etc/resolvconf $IMAGE_PATH/etc/ -rf
|
||||
fi
|
||||
cp /etc/resolv.conf $IMAGE_PATH/etc/
|
||||
cp /etc/hosts $IMAGE_PATH/etc/
|
||||
echo $IMAGE_VER > $IMAGE_PATH/VERSION
|
||||
}}
|
||||
|
||||
get_link_err_nums() {{
|
||||
|
||||
find $IMAGE_PATH -type l ! -exec test -e {{}} \; -print | wc -l
|
||||
}}
|
||||
|
||||
if [ ! -d "$HOME/.deepinwine" ];then
|
||||
mkdir -p "$HOME/.deepinwine"
|
||||
fi
|
||||
|
||||
if [ -f $BOTTLE/VERSION ];then
|
||||
old_version=`cat $BOTTLE/VERSION`
|
||||
if [ "$old_version" != "$NEW_VERSION" ];then
|
||||
WINEPREFIX=$BOTTLE $EMU $EMU_ARGS $WINESERVER -k
|
||||
rm -rf $BOTTLE
|
||||
fi
|
||||
fi
|
||||
Update_D() {{
|
||||
if [ -L "$BOTTLE/dosdevices/d:" ]; then
|
||||
rm -f "$BOTTLE/dosdevices/d:"
|
||||
ln -s $Downloads "$BOTTLE/dosdevices/d:"
|
||||
fi
|
||||
if [ -L "$BOTTLE/dosdevices/d:" ]; then
|
||||
rm -f "$BOTTLE/dosdevices/d:"
|
||||
ln -s $Downloads "$BOTTLE/dosdevices/d:"
|
||||
fi
|
||||
}}
|
||||
if [ ! -d $BOTTLE ];then
|
||||
|
||||
7z x "$DEB_PATH/files/files.7z" -o"$BOTTLE" -aoa
|
||||
mv "$BOTTLE/drive_c/users/@current_user@" "$BOTTLE/drive_c/users/$USER"
|
||||
sed -i "s#@current_user@#$USER#" $BOTTLE/*.reg
|
||||
reconstruct_bottle_symlink
|
||||
echo $NEW_VERSION > $BOTTLE/VERSION
|
||||
fi
|
||||
|
||||
if [ ! -z "$KUNPENG" ];then
|
||||
if [ ! -e $IMAGE_PATH/VERSION ];then
|
||||
extract_image
|
||||
fi
|
||||
|
||||
OLD_IMAGE_VER=`cat $IMAGE_PATH/VERSION`
|
||||
if [ "$OLD_IMAGE_VER" != "$IMAGE_VER" ];then
|
||||
extract_image
|
||||
fi
|
||||
|
||||
echo "======$(get_link_err_nums)===="
|
||||
if [ "$(get_link_err_nums)" -gt "120" ];then
|
||||
extract_image
|
||||
fi
|
||||
fi
|
||||
|
||||
## mount /data/ dir to geust
|
||||
if [ -d $IMAGE_PATH ] && [ ! -d $IMAGE_PATH/data ];then
|
||||
mkdir $IMAGE_PATH/data
|
||||
cp $DEB_PATH/files/exa/vpaths-list $IMAGE_PATH/.exagear
|
||||
fi
|
||||
|
||||
export WINEPREDLL=$DEB_PATH/files/dlls
|
||||
export ATTACH_FILE_DIALOG=1
|
||||
export WINEDLLPATH=/opt/deepin-wine6-stable/lib
|
||||
WINEPREFIX=$BOTTLE $EMU $EMU_ARGS $WINE $WINE wineboot --init
|
||||
Update_D
|
||||
WINEPREFIX=$BOTTLE $EMU $EMU_ARGS $WINE "$EXE" --disable-gpu &""",
|
||||
"info": f'''{{
|
||||
"appid": "{e1_text.text()}",
|
||||
"name": "{e8_text.text()}",
|
||||
"version": "{e2_text.text()}",
|
||||
"arch": ["arm64"],
|
||||
"permissions": {{
|
||||
"autostart": false,
|
||||
"notification": false,
|
||||
"trayicon": true,
|
||||
"clipboard": true,
|
||||
"account": false,
|
||||
"bluetooth": false,
|
||||
"camera": true,
|
||||
"audio_record": true,
|
||||
"installed_apps": false
|
||||
}}
|
||||
}}'''}
|
||||
]
|
||||
#############
|
||||
# 删除文件
|
||||
#############
|
||||
self.label.emit("正在删除对构建 deb 包有影响的文件……")
|
||||
debPackagePath = f"/tmp/{random.randint(0, 9999)}"
|
||||
self.run_command(f"rm -rfv /tmp/{debPackagePath}")
|
||||
###############
|
||||
# 创建目录
|
||||
###############
|
||||
self.label.emit("正在创建目录……")
|
||||
os.makedirs("{}/DEBIAN".format(debPackagePath))
|
||||
os.makedirs("{}/opt/apps/{}/entries/applications".format(debPackagePath, e1_text.text()))
|
||||
os.makedirs("{}/opt/apps/{}/entries/icons/hicolor/scalable/apps".format(debPackagePath, e1_text.text()))
|
||||
os.makedirs("{}/opt/apps/{}/files".format(debPackagePath, e1_text.text()))
|
||||
###############
|
||||
# 创建文件
|
||||
###############
|
||||
self.label.emit("正在创建文件……")
|
||||
os.mknod("{}/DEBIAN/control".format(debPackagePath))
|
||||
os.mknod("{}/opt/apps/{}/entries/applications/{}.desktop".format(debPackagePath, e1_text.text(), e1_text.text()))
|
||||
os.mknod("{}/opt/apps/{}/files/run.sh".format(debPackagePath, e1_text.text()))
|
||||
os.mknod("{}/opt/apps/{}/info".format(debPackagePath, e1_text.text()))
|
||||
###############
|
||||
# 设置容器
|
||||
###############
|
||||
self.label.emit("正在设置 wine 容器")
|
||||
os.chdir(b)
|
||||
self.run_command("sed -i \"s#$USER#@current_user@#\" ./*.reg")
|
||||
os.chdir(f"{b}/drive_c/users")
|
||||
self.run_command(f"mv -v '{os.getlogin()}' @current_user@")
|
||||
os.chdir(programPath)
|
||||
if cleanBottonByUOS.isChecked():
|
||||
self.run_command(f"WINE='{debInformation[debArch.currentIndex()]['Wine']}' '{programPath}/cleanbottle.sh' '{b}'")
|
||||
###############
|
||||
# 压缩容器
|
||||
###############
|
||||
self.label.emit("正在打包 wine 容器")
|
||||
self.run_command("7z a {}/opt/apps/{}/files/files.7z {}/*".format(debPackagePath, e1_text.text(), b))
|
||||
###############
|
||||
# 复制图片
|
||||
###############
|
||||
self.label.emit("正在复制文件……")
|
||||
# arm64 box86 需要复制 dlls-arm 目录
|
||||
if debArch.currentIndex() == 0:
|
||||
if not os.path.exists(f"{programPath}/dlls"):
|
||||
self.run_command(f"7z x \"{programPath}/dlls.7z\" -o\"{programPath}\"")
|
||||
os.remove(f"{programPath}/dlls.7z")
|
||||
self.run_command(f"cp -rv '{programPath}/dlls' {debPackagePath}/opt/apps/{e1_text.text()}/files/")
|
||||
elif debArch.currentIndex() == 1:
|
||||
if not os.path.exists(f"{programPath}/dlls-arm"):
|
||||
self.run_command(f"7z x \"{programPath}/dlls-arm.7z\" -o\"{programPath}\"")
|
||||
os.remove(f"{programPath}/dlls-arm.7z")
|
||||
if not os.path.exists(f"{programPath}/wined3d.dll.so"):
|
||||
self.run_command(f"7z x \"{programPath}/wined3d.dll.so.7z\" -o\"{programPath}\"")
|
||||
os.remove(f"{programPath}/wined3d.dll.so.7z")
|
||||
self.run_command(f"cp -rv '{programPath}/dlls-arm' {debPackagePath}/opt/apps/{e1_text.text()}/files/dlls")
|
||||
self.run_command(f"cp -rv '{programPath}/wined3d.dll.so' {debPackagePath}/opt/apps/{e1_text.text()}/files/")
|
||||
elif debArch.currentIndex() == 2:
|
||||
if not os.path.exists(f"{programPath}/exagear"):
|
||||
self.run_command(f"aria2c -x 16 -s 16 -d \"{programPath}\" -o \"exagear.7z\" https://gitlink.org.cn/api/attachments/392441")
|
||||
self.run_command(f"7z x \"{programPath}/exagear.7z\" -o\"{programPath}\"")
|
||||
os.remove(f"{programPath}/exagear.7z")
|
||||
self.run_command(f"cp -rv '{programPath}/exagear/*' {debPackagePath}/opt/apps/{e1_text.text()}/files/")
|
||||
if e9_text.text() != "":
|
||||
shutil.copy(e9_text.text(), "{}/opt/apps/{}/entries/icons/hicolor/scalable/apps/{}.{}".format(debPackagePath, e1_text.text(), e1_text.text(), imms))
|
||||
################
|
||||
# 获取文件大小
|
||||
################
|
||||
self.label.emit("正在计算文件大小……")
|
||||
size = getFileFolderSize(debPackagePath) / 1024
|
||||
################
|
||||
# 写入文本文档
|
||||
################
|
||||
self.label.emit("正在写入文件……")
|
||||
|
||||
write_txt(f"{debPackagePath}/DEBIAN/control", f'''Package: {e1_text.text()}
|
||||
Version: {e2_text.text()}
|
||||
Architecture: {debInformation[debArch.currentIndex()]["Architecture"]}
|
||||
Maintainer: {e4_text.text()}
|
||||
Depends: {debInformation[debArch.currentIndex()]["Depends"]}
|
||||
Section: non-free/otherosfs
|
||||
Priority: optional
|
||||
Multi-Arch: foreign
|
||||
Description: {e3_text.text()}
|
||||
''')
|
||||
if debInformation[debArch.currentIndex()]["postinst"] != "":
|
||||
write_txt(f"{debPackagePath}/DEBIAN/postinst", debInformation[debArch.currentIndex()]["postinst"])
|
||||
if debInformation[debArch.currentIndex()]["postrm"] != "":
|
||||
write_txt(f"{debPackagePath}/DEBIAN/postrm", debInformation[debArch.currentIndex()]["postrm"])
|
||||
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" {}\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(f"{debPackagePath}/opt/apps/{e1_text.text()}/files/run.sh", debInformation[debArch.currentIndex()]["run.sh"])
|
||||
write_txt("{}/opt/apps/{}/info".format(debPackagePath, e1_text.text()), debInformation[debArch.currentIndex()]["info"])
|
||||
################
|
||||
# 修改文件权限
|
||||
################
|
||||
self.label.emit("正在修改文件权限……")
|
||||
self.run_command("chmod -Rv 644 {}/opt/apps/{}/files/run.sh".format(debPackagePath, e1_text.text()))
|
||||
self.run_command("chmod -Rv 644 {}/opt/apps/{}/info".format(debPackagePath, e1_text.text()))
|
||||
self.run_command("chmod -Rv 0755 {}/DEBIAN".format(debPackagePath))
|
||||
self.run_command("chmod -Rv 755 {}/opt/apps/{}/files/run.sh".format(debPackagePath, e1_text.text()))
|
||||
self.run_command("chmod -Rv 755 {}/opt/apps/{}/entries/applications/{}.desktop".format(debPackagePath, e1_text.text(), e1_text.text()))
|
||||
################
|
||||
@@ -482,6 +813,18 @@ def readtxt(path):
|
||||
def get_home():
|
||||
return os.path.expanduser('~')
|
||||
|
||||
def ChangeArchCombobox():
|
||||
global chooseWineHelperValue
|
||||
option = True
|
||||
if debArch.currentIndex() != 0:
|
||||
option = False
|
||||
chooseWineHelperValue.setEnabled(option)
|
||||
wineVersion.setEnabled(option)
|
||||
|
||||
#chooseWineHelperValue.setEnabled(option)
|
||||
rmBash.setEnabled(option)
|
||||
|
||||
|
||||
###############
|
||||
# 程序信息
|
||||
###############
|
||||
@@ -530,7 +873,13 @@ button1 = QtWidgets.QPushButton("浏览……")
|
||||
button2 = QtWidgets.QPushButton("浏览……")
|
||||
button4 = QtWidgets.QPushButton("浏览……")
|
||||
button5 = QtWidgets.QPushButton("打包……")
|
||||
debOption = QtWidgets.QHBoxLayout()
|
||||
rmBash = QtWidgets.QCheckBox("设置卸载该 deb 后自动删除该容器")
|
||||
cleanBottonByUOS = QtWidgets.QCheckBox("使用统信 Wine 生态适配活动容器清理脚本")
|
||||
debOption.addWidget(rmBash)
|
||||
debOption.addWidget(cleanBottonByUOS)
|
||||
debArch = QtWidgets.QComboBox()
|
||||
debArch.addItems(["i386", "arm64(box86)", "arm64(exagear)"])
|
||||
textbox1 = QtWidgets.QTextBrowser()
|
||||
option1_text.addItems(["Network", "Chat", "Audio", "Video", "Graphics", "Office", "Translation", "Development", "Utility"])
|
||||
option1_text.setCurrentText("Network")
|
||||
@@ -541,6 +890,7 @@ button2.clicked.connect(button2_cl)
|
||||
button4.clicked.connect(button4_cl)
|
||||
button5.clicked.connect(make_deb)
|
||||
wineFrame.addWidget(wineVersion)
|
||||
debArch.currentIndexChanged.connect(ChangeArchCombobox)
|
||||
wineFrame.addWidget(chooseWineHelperValue)
|
||||
# 创建控件
|
||||
widgetLayout.addWidget(QtWidgets.QLabel("要打包的 deb 包的包名(※必填):"), 0, 0, 1, 1)
|
||||
@@ -557,7 +907,8 @@ widgetLayout.addWidget(QtWidgets.QLabel("要显示的 .desktop 文件的图标
|
||||
widgetLayout.addWidget(QtWidgets.QLabel("要显示的 .desktop 文件的 MimeType 内容(选填):"), 11, 0, 1, 1)
|
||||
widgetLayout.addWidget(QtWidgets.QLabel("选择打包的 wine 版本(※必选):"), 12, 0, 1, 1)
|
||||
widgetLayout.addWidget(QtWidgets.QLabel("打包 deb 的保存路径(※必填):"), 13, 0, 1, 1)
|
||||
widgetLayout.addWidget(QtWidgets.QLabel("自动删除选项(选填):"), 14, 0, 1, 1)
|
||||
widgetLayout.addWidget(QtWidgets.QLabel("deb 包选项(选填):"), 14, 0, 1, 1)
|
||||
widgetLayout.addWidget(QtWidgets.QLabel("打包 deb 架构(※必选):"), 15, 0, 1, 1)
|
||||
widgetLayout.addWidget(e1_text, 0, 1, 1, 1)
|
||||
widgetLayout.addWidget(e2_text, 1, 1, 1, 1)
|
||||
widgetLayout.addWidget(e3_text, 2, 1, 1, 1)
|
||||
@@ -575,10 +926,11 @@ widgetLayout.addWidget(e10_text, 11, 1, 1, 1)
|
||||
widgetLayout.addLayout(wineFrame, 12, 1, 1, 1)
|
||||
widgetLayout.addWidget(e12_text, 13, 1, 1, 1)
|
||||
widgetLayout.addWidget(button4, 13, 2, 1, 1)
|
||||
widgetLayout.addWidget(rmBash, 14, 1, 1, 1)
|
||||
widgetLayout.addWidget(button5, 15, 1, 1, 1)
|
||||
widgetLayout.addWidget(label13_text, 16, 0, 1, 3)
|
||||
widgetLayout.addWidget(textbox1, 17, 0, 1, 3)
|
||||
widgetLayout.addLayout(debOption, 14, 1, 1, 1)
|
||||
widgetLayout.addWidget(debArch, 15, 1, 1, 1)
|
||||
widgetLayout.addWidget(button5, 16, 1, 1, 1)
|
||||
widgetLayout.addWidget(label13_text, 17, 0, 1, 3)
|
||||
widgetLayout.addWidget(textbox1, 18, 0, 1, 3)
|
||||
menu = window.menuBar()
|
||||
programmenu = menu.addMenu("程序")
|
||||
help = menu.addMenu("帮助")
|
||||
|
||||
@@ -85,7 +85,7 @@ run = None
|
||||
def runexebutton(self):
|
||||
global run
|
||||
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() != "基于 box86 的 deepin-wine6-stable":
|
||||
if not CheckProgramIsInstall(wine[o1.currentText()]) and not o1.currentText() in untipsWine:
|
||||
if QtWidgets.QMessageBox.question(widget, "提示", "检查到您未安装这个 wine,是否继续使用这个 wine 运行?") == QtWidgets.QMessageBox.No:
|
||||
DisableButton(False)
|
||||
return
|
||||
@@ -148,6 +148,14 @@ class Runexebutton_threading(QtCore.QThread):
|
||||
wineUsingOption = ""
|
||||
if o1.currentText() == "基于 exagear 的 deepin-wine6-stable" or o1.currentText() == "基于 box86 的 deepin-wine6-stable":
|
||||
wineUsingOption = "--disable-gpu"
|
||||
if o1.currentText() == "基于 exagear 的 deepin-wine6-stable":
|
||||
os.system(f"'{programPath}/deepin-wine-runner-create-botton.py' '{wineBottonPath}'")
|
||||
if o1.currentText() == "基于 box86 的 deepin-wine6-stable":
|
||||
if not os.path.exists(f"{programPath}/dlls-arm"):
|
||||
if os.system(f"7z x \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""):
|
||||
QtWidgets.QMessageBox(widget, "错误", "无法解压资源")
|
||||
return
|
||||
os.remove(f"{programPath}/dlls-arm.7z")
|
||||
if setting["TerminalOpen"]:
|
||||
res = subprocess.Popen([f"'{programPath}/launch.sh' deepin-terminal -C \"WINEPREFIX='" + wineBottonPath + "' " + option + wine[o1.currentText()] + " '" + e2.currentText() + "' " + setting["WineOption"] + "\" --keep-open" + wineUsingOption], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
else:
|
||||
@@ -160,7 +168,7 @@ class Runexebutton_threading(QtCore.QThread):
|
||||
except:
|
||||
text = ""
|
||||
self.signal.emit(text)
|
||||
print(text)
|
||||
print(text, end="")
|
||||
if len(findExeHistory) == 0 or findExeHistory[-1] != wineBottonPath:
|
||||
findExeHistory.append(wineBottonPath) # 将记录写进数组
|
||||
write_txt(get_home() + "/.config/deepin-wine-runner/FindExeHistory.json", str(json.dumps(ListToDictionary(findExeHistory)))) # 将历史记录的数组转换为字典并写入
|
||||
@@ -208,7 +216,7 @@ def make_desktop_on_launcher():
|
||||
if combobox1.currentText() == "" or e2.currentText() == "": # 判断文本框是否有内容
|
||||
QtWidgets.QMessageBox.information(widget, "提示", "没有填写需要使用 exe 应用或保存的文件名")
|
||||
return
|
||||
if not CheckProgramIsInstall(wine[o1.currentText()]):
|
||||
if not CheckProgramIsInstall(wine[o1.currentText()]) and not o1.currentText() in untipsWine:
|
||||
if QtWidgets.QMessageBox.question(widget, "提示", "检查到您未安装这个 wine,是否继续使用这个 wine 写入?") == QtWidgets.QMessageBox.No:
|
||||
DisableButton(False)
|
||||
return
|
||||
@@ -229,6 +237,12 @@ def make_desktop_on_launcher():
|
||||
if not setting["Debug"]:
|
||||
option += "WINEDEBUG=-all "
|
||||
wineUsingOption = ""
|
||||
if o1.currentText() == "基于 box86 的 deepin-wine6-stable":
|
||||
if not os.path.exists(f"{programPath}/dlls-arm"):
|
||||
if os.system(f"7z x \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""):
|
||||
QtWidgets.QMessageBox(widget, "错误", "无法解压资源")
|
||||
return
|
||||
os.remove(f"{programPath}/dlls-arm.7z")
|
||||
if o1.currentText() == "基于 exagear 的 deepin-wine6-stable" or o1.currentText() == "基于 box86 的 deepin-wine6-stable":
|
||||
wineUsingOption = "--disable-gpu"
|
||||
write_txt(get_home() + "/.local/share/applications/" + combobox1.currentText() + ".desktop", f'''[Desktop Entry]
|
||||
@@ -254,7 +268,7 @@ def make_desktop_on_desktop():
|
||||
if combobox1.currentText() == "" or e2.currentText() == "": # 判断文本框是否有内容
|
||||
QtWidgets.QMessageBox.information(widget, "提示", "没有填写需要使用 exe 应用或保存的文件名")
|
||||
return
|
||||
if not CheckProgramIsInstall(wine[o1.currentText()]):
|
||||
if not CheckProgramIsInstall(wine[o1.currentText()]) and not o1.currentText() in untipsWine:
|
||||
if QtWidgets.QMessageBox.question(widget, "提示", "检查到您未安装这个 wine,是否继续使用这个 wine 写入?") == QtWidgets.QMessageBox.No:
|
||||
DisableButton(False)
|
||||
return
|
||||
@@ -272,6 +286,12 @@ def make_desktop_on_desktop():
|
||||
wineUsingOption = ""
|
||||
if o1.currentText() == "基于 exagear 的 deepin-wine6-stable" or o1.currentText() == "基于 box86 的 deepin-wine6-stable":
|
||||
wineUsingOption = "--disable-gpu"
|
||||
if o1.currentText() == "基于 box86 的 deepin-wine6-stable":
|
||||
if not os.path.exists(f"{programPath}/dlls-arm"):
|
||||
if os.system(f"7z x \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""):
|
||||
QtWidgets.QMessageBox(widget, "错误", "无法解压资源")
|
||||
return
|
||||
os.remove(f"{programPath}/dlls-arm.7z")
|
||||
if not os.path.exists(get_desktop_path()):
|
||||
os.makedirs(get_home())
|
||||
os.mknod(get_desktop_path() + "/" + combobox1.currentText() + ".desktop")
|
||||
@@ -336,6 +356,9 @@ def InstallWine():
|
||||
def InstallWineOnDeepin23():
|
||||
threading.Thread(target=os.system, args=[f"'{programPath}/launch.sh' deepin-terminal -e \"{programPath}/InstallWineOnDeepin23.py\""]).start()
|
||||
|
||||
def InstallWineHQ():
|
||||
threading.Thread(target=os.system, args=[f"'{programPath}/launch.sh' deepin-terminal -e \"{programPath}/InstallNewWineHQ.sh\""]).start()
|
||||
|
||||
def OpenWineBotton():
|
||||
if e1.currentText() == "":
|
||||
wineBottonPath = setting["DefultBotton"]
|
||||
@@ -373,10 +396,18 @@ class RunWineProgramThread(QtCore.QThread):
|
||||
if not setting["Debug"]:
|
||||
option += "WINEDEBUG=-all "
|
||||
wineUsingOption = ""
|
||||
if o1.currentText() == "基于 exagear 的 deepin-wine6-stable":
|
||||
os.system(f"'{programPath}/deepin-wine-runner-create-botton.py' '{wineBottonPath}'")
|
||||
if o1.currentText() == "基于 exagear 的 deepin-wine6-stable" or o1.currentText() == "基于 box86 的 deepin-wine6-stable":
|
||||
wineUsingOption = "--disable-gpu"
|
||||
if o1.currentText() == "基于 box86 的 deepin-wine6-stable":
|
||||
if not os.path.exists(f"{programPath}/dlls-arm"):
|
||||
if os.system(f"7z x \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""):
|
||||
QtWidgets.QMessageBox(widget, "错误", "无法解压资源")
|
||||
return
|
||||
os.remove(f"{programPath}/dlls-arm.7z")
|
||||
if setting["TerminalOpen"]:
|
||||
res = subprocess.Popen([f"'{programPath}/launch.sh' deepin-terminal -C \"WINEPREFIX='" + wineBottonPath + "' " + option + wine[o1.currentText()] + " '" + self.wineProgram + "' " + setting["WineOption"] + "\" --keep-open"], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
res = subprocess.Popen([f"'{programPath}/launch.sh' deepin-terminal -C \"WINEPREFIX='" + wineBottonPath + "' " + option + wine[o1.currentText()] + " '" + self.wineProgram + "' " + setting["WineOption"] + " " + wineUsingOption + "\" --keep-open"], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
else:
|
||||
res = subprocess.Popen(["WINEPREFIX='" + wineBottonPath + "' " + option + wine[o1.currentText()] + " '" + self.wineProgram + "' " + setting["WineOption"]], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
# 实时读取程序返回
|
||||
@@ -386,7 +417,7 @@ class RunWineProgramThread(QtCore.QThread):
|
||||
except:
|
||||
text = ""
|
||||
self.signal.emit(text)
|
||||
print(text)
|
||||
print(text, end="")
|
||||
if self.history:
|
||||
if len(findExeHistory) == 0 or findExeHistory[-1] != wineBottonPath:
|
||||
findExeHistory.append(wineBottonPath) # 将记录写进数组
|
||||
@@ -404,7 +435,7 @@ def RunWineProgram(wineProgram, history = False, Disbled = True):
|
||||
global runProgram
|
||||
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() != "基于 box86 的 deepin-wine6-stable":
|
||||
if QtWidgets.QMessageBox.question(widget, "提示", "检查到您未安装这个 wine,是否继续使用这个 wine 运行?") == QtWidgets.QMessageBox.No:
|
||||
if not CheckProgramIsInstall(wine[o1.currentText()]) and not o1.currentText() in untipsWine:
|
||||
DisableButton(False)
|
||||
return
|
||||
returnText.setText("")
|
||||
@@ -427,8 +458,17 @@ class RunWinetricksThread(QtCore.QThread):
|
||||
option += f"WINEARCH={setting['Architecture']} "
|
||||
if not setting["Debug"]:
|
||||
option += "WINEDEBUG=-all "
|
||||
wineUsingOption = ""
|
||||
if o1.currentText() == "基于 exagear 的 deepin-wine6-stable" or o1.currentText() == "基于 box86 的 deepin-wine6-stable":
|
||||
wineUsingOption = "--disable-gpu"
|
||||
if o1.currentText() == "基于 box86 的 deepin-wine6-stable":
|
||||
if not os.path.exists(f"{programPath}/dlls-arm"):
|
||||
if os.system(f"7z x \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""):
|
||||
QtWidgets.QMessageBox(widget, "错误", "无法解压资源")
|
||||
return
|
||||
os.remove(f"{programPath}/dlls-arm.7z")
|
||||
if setting["TerminalOpen"]:
|
||||
res = subprocess.Popen([f"'{programPath}/launch.sh' deepin-terminal -C \"WINEPREFIX='{wineBottonPath}' {option} WINE=" + subprocess.getoutput(f"which {wine[o1.currentText()]}").replace(" ", "").replace("\n", "") + " winetricks --gui\" --keep-open"], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
res = subprocess.Popen([f"'{programPath}/launch.sh' deepin-terminal -C \"WINEPREFIX='{wineBottonPath}' {option} WINE=" + subprocess.getoutput(f"which {wine[o1.currentText()]}").replace(" ", "").replace("\n", "") + f" winetricks --gui {wineUsingOption}\" --keep-open"], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
else:
|
||||
res = subprocess.Popen([f"WINEPREFIX='{wineBottonPath}' {option} WINE='" + subprocess.getoutput(f"which {wine[o1.currentText()]}").replace(" ", "").replace("\n", "") + "' winetricks --gui"], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
# 实时读取程序返回
|
||||
@@ -445,21 +485,34 @@ runWinetricks = None
|
||||
def RunWinetricks():
|
||||
global runWinetricks
|
||||
DisableButton(True)
|
||||
if not CheckProgramIsInstall(wine[o1.currentText()]):
|
||||
if QtWidgets.QMessageBox.question(widget, "提示", "检查到您未安装这个 wine,是否继续使用这个 wine 运行?") == QtWidgets.QMessageBox.No:
|
||||
if not CheckProgramIsInstall(wine[o1.currentText()]) and o1.currentText() != "基于 linglong 的 deepin-wine6-stable(不推荐)" and o1.currentText() != "基于 exagear 的 deepin-wine6-stable" and o1.currentText() != "基于 box86 的 deepin-wine6-stable":
|
||||
if not CheckProgramIsInstall(wine[o1.currentText()]) and not o1.currentText() in untipsWine:
|
||||
DisableButton(False)
|
||||
return
|
||||
if o1.currentText() == "基于 box86 的 deepin-wine6-stable":
|
||||
if not os.path.exists(f"{programPath}/dlls-arm"):
|
||||
if os.system(f"7z x \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""):
|
||||
QtWidgets.QMessageBox(widget, "错误", "无法解压资源")
|
||||
return
|
||||
os.remove(f"{programPath}/dlls-arm.7z")
|
||||
returnText.setText("")
|
||||
runWinetricks = RunWinetricksThread()
|
||||
runWinetricks.signal.connect(QT.ShowWineReturn)
|
||||
runWinetricks.start()
|
||||
|
||||
|
||||
def CleanWineBottonByUOS():
|
||||
if e1.currentText() == "":
|
||||
wineBottonPath = setting["DefultBotton"]
|
||||
else:
|
||||
wineBottonPath = e1.currentText()
|
||||
os.system(f"'{programPath}/launch.sh' deepin-terminal -C \"WINE='{wine[o1.currentText()]}' '{programPath}/cleanbottle.sh' '{wineBottonPath}'; echo 按回车退出; read; read; exit;\"")
|
||||
|
||||
def FontAppStore():
|
||||
if e1.currentText() == "":
|
||||
wineBottonPath = setting["DefultBotton"]
|
||||
else:
|
||||
wineBottonPath = e1.currentText()
|
||||
os.system(f"'{programPath}/launch.sh' deepin-terminal -e '{programPath}/InstallFont.py' '{wineBottonPath}' {int(setting['RuntimeCache'])}")
|
||||
os.system(f"WINE='{programPath}/launch.sh' deepin-terminal -e '{programPath}/InstallFont.py' '{wineBottonPath}' {int(setting['RuntimeCache'])}")
|
||||
|
||||
def InstallMonoGecko(program):
|
||||
if e1.currentText() == "":
|
||||
@@ -490,6 +543,11 @@ def InstallMSXML():
|
||||
os.system(f"'{programPath}/launch.sh' deepin-terminal -e '{programPath}/InstallMsxml.py' '{wineBottonPath}' '{wine[o1.currentText()]}' {int(setting['RuntimeCache'])}")
|
||||
|
||||
def InstallDXVK():
|
||||
if not os.path.exists(f"{programPath}/dxvk"):
|
||||
if os.system(f"7z x \"{programPath}/dxvk.7z\" -o\"{programPath}\""):
|
||||
QtWidgets.QMessageBox(widget, "错误", "无法解压资源")
|
||||
return
|
||||
os.remove(f"{programPath}/dxvk.7z")
|
||||
if e1.currentText() == "":
|
||||
wineBottonPath = setting["DefultBotton"]
|
||||
else:
|
||||
@@ -500,6 +558,11 @@ def InstallDXVK():
|
||||
f"{programPath}/dxvk/setup_dxvk.sh", "install"])
|
||||
|
||||
def UninstallDXVK():
|
||||
if not os.path.exists(f"{programPath}/dxvk"):
|
||||
if os.system(f"7z x \"{programPath}/dxvk.7z\" -o\"{programPath}\""):
|
||||
QtWidgets.QMessageBox(widget, "错误", "无法解压资源")
|
||||
return
|
||||
os.remove(f"{programPath}/dxvk.7z")
|
||||
if e1.currentText() == "":
|
||||
wineBottonPath = setting["DefultBotton"]
|
||||
else:
|
||||
@@ -610,6 +673,9 @@ def UOSPackageScript():
|
||||
def RunVM():
|
||||
threading.Thread(target=os.system, args=[f"bash '{programPath}/RunVM.sh'"]).start()
|
||||
|
||||
def CleanProgram():
|
||||
os.system(f"'{programPath}/launch.sh' deepin-terminal -e \"{programPath}/clean-unuse-program.py\"")
|
||||
|
||||
class UpdateWindow():
|
||||
data = {}
|
||||
update = None
|
||||
@@ -1004,10 +1070,28 @@ if not os.path.exists(get_home() + "/.config/deepin-wine-runner/WineSetting.json
|
||||
###########################
|
||||
# 设置变量
|
||||
###########################
|
||||
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
|
||||
# 如果要添加其他 wine,请在字典添加其名称和执行路径
|
||||
try:
|
||||
wine = {"deepin-wine": "deepin-wine", "deepin-wine5": "deepin-wine5", "wine": "wine", "wine64": "wine64", "deepin-wine5 stable": "deepin-wine5-stable", "deepin-wine6 stable": "deepin-wine6-stable", "spark-wine7-devel": "spark-wine7-devel", "ukylin-wine": "ukylin-wine"}
|
||||
wine = {
|
||||
"基于 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"/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-wine5 stable": "deepin-wine5-stable",
|
||||
"spark-wine7-devel": "spark-wine7-devel",
|
||||
"deepin-wine": "deepin-wine",
|
||||
"deepin-wine5": "deepin-wine5",
|
||||
"wine": "wine",
|
||||
"wine64": "wine64",
|
||||
"ukylin-wine": "ukylin-wine",
|
||||
"基于 linglong 的 deepin-wine6-stable(不推荐)": f"ll-cli run '' --exec '/bin/deepin-wine6-stable'"
|
||||
}
|
||||
untipsWine = ["基于 box86 的 deepin-wine6-stable", "基于 exagear 的 deepin-wine6-stable", "基于 linglong 的 deepin-wine6-stable(不推荐)"]
|
||||
canUseWine = []
|
||||
if os.path.exists("/opt/deepin-box86/box86"):
|
||||
canUseWine.append("基于 box86 的 deepin-wine6-stable")
|
||||
if os.path.exists("/opt/exagear/bin/ubt_x64a64_al"):
|
||||
canUseWine.append("基于 exagear 的 deepin-wine6-stable")
|
||||
for i in wine.keys():
|
||||
if not os.system(f"which '{wine[i]}'"):
|
||||
canUseWine.append(i)
|
||||
@@ -1022,12 +1106,6 @@ try:
|
||||
break
|
||||
except:
|
||||
pass
|
||||
if os.path.exists("/opt/deepin-box86/box86"):
|
||||
wine["基于 box86 的 deepin-wine6-stable"] = f"BOX86_NOSIGSEGV=1 /opt/deepin-box86/box86 /opt/deepin-wine6-stable/bin/wine "
|
||||
canUseWine.append("基于 box86 的 deepin-wine6-stable")
|
||||
if os.path.exists("/opt/exagear/bin/ubt_x64a64_al"):
|
||||
wine["基于 exagear 的 deepin-wine6-stable"] = f"/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 "
|
||||
canUseWine.append("基于 exagear 的 deepin-wine6-stable")
|
||||
shellHistory = list(json.loads(readtxt(get_home() + "/.config/deepin-wine-runner/ShellHistory.json")).values())
|
||||
findExeHistory = list(json.loads(readtxt(get_home() + "/.config/deepin-wine-runner/FindExeHistory.json")).values())
|
||||
wineBottonHistory = list(json.loads(readtxt(get_home() + "/.config/deepin-wine-runner/WineBottonHistory.json")).values())
|
||||
@@ -1050,7 +1128,6 @@ except:
|
||||
###########################
|
||||
# 程序信息
|
||||
###########################
|
||||
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
|
||||
iconPath = "{}/deepin-wine-runner.svg".format(programPath)
|
||||
programUrl = "https://gitee.com/gfdgd-xi/deep-wine-runner\nhttps://github.com/gfdgd-xi/deep-wine-runner\nhttps://www.gitlink.org.cn/gfdgd_xi/deep-wine-runner"
|
||||
information = json.loads(readtxt(f"{programPath}/information.json"))
|
||||
@@ -1065,26 +1142,30 @@ tips = '''<h4>提示:</h4>
|
||||
exe路径\' 参数 \'
|
||||
即可(单引号需要输入)
|
||||
5、wine 容器如果没有指定,则会默认为 ~/.wine
|
||||
6、在使用 linglong 包的 Wine 应用时,必须安装至少一个 linglong 的使用 Wine 软件包才会出现该选项,
|
||||
6、对于非 X86 的用户来说,请不要使用本程序自带的 Wine 安装程序和 Windows 虚拟机安装功能(检测到为非 X86 架构会自动禁用)
|
||||
7、在使用 linglong 包的 Wine 应用时,必须安装至少一个 linglong 的使用 Wine 软件包才会出现该选项,
|
||||
而程序识别到的 Wine 是按 linglong 的使用 Wine 软件包名的字母排序第一个的 Wine,且生成的容器不在用户目录下,而是在容器的用户目录下(~/.deepinwine、/tmp、桌面、下载、文档等被映射的目录除外),
|
||||
同理需要运行的 EXE 也必须在被映射的目录内
|
||||
7、如果是使用 Deepin 23 的 Wine 安装脚本,请切记——安装过程会临时添加 Deepin 20 的 apt 源,不要中断安装以及
|
||||
8、如果是使用 Deepin 23 的 Wine 安装脚本,请切记——安装过程会临时添加 Deepin 20 的 apt 源,不要中断安装以及
|
||||
<b>千万不要中断后不删除源的情况下 apt upgrade !!!</b>中断后只需重新打开脚本输入 repair 或者随意安装一个 Wine(会自动执行恢复操作)即可
|
||||
以及此脚本安装的 Wine 无法保证 100% 能使用,以及副作用是会提示
|
||||
<code>N: 鉴于仓库 'https://community-packages.deepin.com/beige beige InRelease' 不支持 'i386' 体系结构,跳过配置文件 'main/binary-i386/Packages' 的获取。</code>'''
|
||||
updateThingsString = '''※1、修复了重复路径一直自动重复增加的问题
|
||||
updateThingsString = '''<b>※1、修复了重复路径一直自动重复增加的问题
|
||||
※2、修复了两个打包器打包错误的问题(非基于生态活动脚本的为 wine 导入错误,基于生态活动脚本的为架构有误导致打包出的 deb 无法打包)
|
||||
※3、适配了部分非 i386、amd64 架构计算机的 UOS 系统使用的 wine
|
||||
※3、适配了部分非 i386、amd64 架构计算机的 UOS 系统使用的 wine 并支持打包非 i386、amd64 架构计算机的 UOS 系统使用的 wine 程序 deb 包
|
||||
※4、支持安装 dxvk(遵守 Zlib 开源协议)
|
||||
5、支持不显示没有安装的 Wine,方便用户识别
|
||||
6、增加字体商店
|
||||
※5、运行器、打包器(包括非基于生态适配活动脚本制作的)支持使用 Wine 生态适配活动的容器清理脚本</b>
|
||||
6、支持不显示没有安装的 Wine,方便用户识别
|
||||
7、增加字体商店
|
||||
8、修改了 Wine 的顺序使其更加合理
|
||||
'''
|
||||
for i in information["Thank"]:
|
||||
thankText += f"{i}\n"
|
||||
updateTime = "2022年08月05日"
|
||||
updateTime = "2022年08月11日"
|
||||
about = f'''<h1>关于</h1>
|
||||
<p>一个能让Linux用户更加方便运行Windows应用的程序,内置了对wine图形话的支持和各种Wine工具和自制Wine程序打包器、运行库安装工具等等</p>
|
||||
<p>同时也内置了基于VirtualBox制作的小白Windows虚拟机安装工具,可以做到只需要用户下载系统镜像并点击安装即可,无需顾及虚拟机安装、创建、虚拟机的分区等等</p>
|
||||
<p>本程序依照 GPLV3 协议开源</p>
|
||||
<pre>
|
||||
|
||||
一个图形化了如下命令的程序(最简单格式)
|
||||
@@ -1261,24 +1342,30 @@ menu = window.menuBar()
|
||||
programmenu = menu.addMenu("程序(&P)")
|
||||
p1 = QtWidgets.QAction("安装 wine(&I)")
|
||||
installWineOnDeepin23 = QtWidgets.QAction("安装 wine(只限Deepin23)")
|
||||
installWineHQ = QtWidgets.QAction("安装 WineHQ")
|
||||
p2 = QtWidgets.QAction("设置程序(&S)")
|
||||
p3 = QtWidgets.QAction("清空软件历史记录(&C)")
|
||||
cleanCache = QtWidgets.QAction("清空软件缓存")
|
||||
cleanProgramUnuse = QtWidgets.QAction("删除程序组件")
|
||||
p4 = QtWidgets.QAction("退出程序(&E)")
|
||||
programmenu.addAction(p1)
|
||||
programmenu.addAction(installWineOnDeepin23)
|
||||
programmenu.addAction(installWineHQ)
|
||||
programmenu.addSeparator()
|
||||
programmenu.addAction(p2)
|
||||
programmenu.addSeparator()
|
||||
programmenu.addAction(p3)
|
||||
programmenu.addAction(cleanCache)
|
||||
programmenu.addAction(cleanProgramUnuse)
|
||||
programmenu.addSeparator()
|
||||
programmenu.addAction(p4)
|
||||
p1.triggered.connect(InstallWine)
|
||||
installWineOnDeepin23.triggered.connect(InstallWineOnDeepin23)
|
||||
installWineHQ.triggered.connect(InstallWineHQ)
|
||||
p2.triggered.connect(ProgramSetting.ShowWindow)
|
||||
p3.triggered.connect(CleanProgramHistory)
|
||||
cleanCache.triggered.connect(CleanProgramCache)
|
||||
cleanProgramUnuse.triggered.connect(CleanProgram)
|
||||
p4.triggered.connect(window.close)
|
||||
|
||||
wineOption = menu.addMenu("Wine(&W)")
|
||||
@@ -1286,6 +1373,7 @@ w1 = QtWidgets.QAction("打开 Wine 容器目录")
|
||||
w2 = QtWidgets.QAction("安装常见字体")
|
||||
w3 = QtWidgets.QAction("安装自定义字体")
|
||||
w4 = QtWidgets.QAction("删除选择的 Wine 容器")
|
||||
cleanBottonUOS = QtWidgets.QAction("清理 Wine 容器(基于 Wine 适配活动脚本)")
|
||||
w5 = QtWidgets.QAction("打包 wine 应用")
|
||||
w6 = QtWidgets.QAction("使用官方 Wine 适配活动的脚本进行打包")
|
||||
w7 = QtWidgets.QAction("从镜像获取DLL(只支持Windows XP、Windows Server 2003官方安装镜像)")
|
||||
@@ -1294,6 +1382,7 @@ wineOption.addAction(w1)
|
||||
wineOption.addAction(w2)
|
||||
wineOption.addAction(w3)
|
||||
wineOption.addAction(w4)
|
||||
wineOption.addAction(cleanBottonUOS)
|
||||
wineOption.addSeparator()
|
||||
wineOption.addAction(w5)
|
||||
wineOption.addAction(w6)
|
||||
@@ -1358,6 +1447,7 @@ w1.triggered.connect(OpenWineBotton)
|
||||
w2.triggered.connect(InstallWineFont)
|
||||
w3.triggered.connect(OpenWineFontPath)
|
||||
w4.triggered.connect(DeleteWineBotton)
|
||||
cleanBottonUOS.triggered.connect(CleanWineBottonByUOS)
|
||||
w5.triggered.connect(BuildExeDeb)
|
||||
w6.triggered.connect(UOSPackageScript)
|
||||
w7.triggered.connect(GetDllFromWindowsISO.ShowWindow)
|
||||
@@ -1451,6 +1541,24 @@ if setting["AutoWine"]:
|
||||
o1.addItems(canUseWine)
|
||||
else:
|
||||
o1.addItems(wine.keys())
|
||||
# 禁用被精简掉的控件
|
||||
for i in [
|
||||
[[p1, installWineOnDeepin23, installWineHQ], f"{programPath}/InstallWineOnDeepin23.py"],
|
||||
[[w5], f"{programPath}/deepin-wine-packager.py"],
|
||||
[[w6], f"{programPath}/deepin-wine-packager-with-script.py"],
|
||||
[[p1, v1], f"{programPath}/RunVM.sh"]
|
||||
]:
|
||||
if not os.path.exists(i[1]):
|
||||
for x in i[0]:
|
||||
x.setDisabled(True)
|
||||
# 有些功能是非 X86 不适用的,需要屏蔽
|
||||
if subprocess.getoutput("arch").lower() != "x86_64":
|
||||
p1.setDisabled(True)
|
||||
installWineOnDeepin23.setDisabled(True)
|
||||
virtualMachine.setDisabled(True)
|
||||
v1.setDisabled(True)
|
||||
installWineHQ.setDisabled(True)
|
||||
pass
|
||||
o1.setCurrentText(setting["DefultWine"])
|
||||
e1.setEditText(setting["DefultBotton"])
|
||||
e2.setEditText("")
|
||||
|
||||
4
deb/opt/apps/deepin-wine-runner/deepin.list
Normal file
4
deb/opt/apps/deepin-wine-runner/deepin.list
Normal file
@@ -0,0 +1,4 @@
|
||||
## Generated by deepin-installer
|
||||
deb https://community-packages.deepin.com/deepin/ apricot main contrib non-free
|
||||
# Written by deepin-home-appstore-client
|
||||
deb https://com-store-packages.uniontech.com/appstore deepin appstore
|
||||
BIN
deb/opt/apps/deepin-wine-runner/dlls-arm.7z
Normal file
BIN
deb/opt/apps/deepin-wine-runner/dlls-arm.7z
Normal file
Binary file not shown.
BIN
deb/opt/apps/deepin-wine-runner/dlls.7z
Normal file
BIN
deb/opt/apps/deepin-wine-runner/dlls.7z
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
deb/opt/apps/deepin-wine-runner/dxvk.7z
Normal file
BIN
deb/opt/apps/deepin-wine-runner/dxvk.7z
Normal file
Binary file not shown.
@@ -1,232 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
function wait(){
|
||||
echo Press Enter To Exit
|
||||
read
|
||||
}
|
||||
# default directories
|
||||
dxvk_lib32=${dxvk_lib32:-"x32"}
|
||||
dxvk_lib64=${dxvk_lib64:-"x64"}
|
||||
|
||||
# figure out where we are
|
||||
basedir=$(dirname "$(readlink -f $0)")
|
||||
|
||||
# figure out which action to perform
|
||||
action="$1"
|
||||
|
||||
case "$action" in
|
||||
install)
|
||||
;;
|
||||
uninstall)
|
||||
;;
|
||||
*)
|
||||
echo "Unrecognized action: $action"
|
||||
echo "Usage: $0 [install|uninstall] [--without-dxgi] [--with-d3d10] [--symlink]"
|
||||
wait
|
||||
exit 1
|
||||
esac
|
||||
|
||||
# process arguments
|
||||
shift
|
||||
|
||||
with_dxgi=true
|
||||
with_d3d10=false
|
||||
file_cmd="cp -v"
|
||||
|
||||
while (($# > 0)); do
|
||||
case "$1" in
|
||||
"--without-dxgi")
|
||||
with_dxgi=false
|
||||
;;
|
||||
"--with-d3d10")
|
||||
with_d3d10=true
|
||||
;;
|
||||
"--symlink")
|
||||
file_cmd="ln -s -v"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# check wine prefix before invoking wine, so that we
|
||||
# don't accidentally create one if the user screws up
|
||||
if [ -n "$WINEPREFIX" ] && ! [ -f "$WINEPREFIX/system.reg" ]; then
|
||||
echo "$WINEPREFIX:"' Not a valid wine prefix.' >&2
|
||||
wait
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# find wine executable
|
||||
export WINEDEBUG=-all
|
||||
# disable mscoree and mshtml to avoid downloading
|
||||
# wine gecko and mono
|
||||
export WINEDLLOVERRIDES="mscoree,mshtml="
|
||||
# 专门添加,为了可以使用自定义的 wine
|
||||
wine=$WINE
|
||||
wine64=$WINE64
|
||||
wineboot="$WINE wineboot"
|
||||
if [[ $WINE == "" ]];then
|
||||
wine="wine"
|
||||
fi
|
||||
if [[ $WINE64 == "" ]];then
|
||||
wine64="wine64"
|
||||
fi
|
||||
|
||||
# $PATH is the way for user to control where wine is located (including custom Wine versions).
|
||||
# Pure 64-bit Wine (non Wow64) requries skipping 32-bit steps.
|
||||
# In such case, wine64 and winebooot will be present, but wine binary will be missing,
|
||||
# however it can be present in other PATHs, so it shouldn't be used, to avoid versions mixing.
|
||||
wine_path=$(dirname "$(which $wineboot)")
|
||||
wow64=true
|
||||
if ! [ -f "$wine_path/$wine" ]; then
|
||||
wine=$wine64
|
||||
wow64=false
|
||||
wineboot="$wine64 wineboot"
|
||||
fi
|
||||
|
||||
# resolve 32-bit and 64-bit system32 path
|
||||
winever=$($wine --version | grep wine)
|
||||
if [ -z "$winever" ]; then
|
||||
echo "$wine:"' Not a wine executable. Check your $wine.' >&2
|
||||
wait
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ensure wine placeholder dlls are recreated
|
||||
# if they are missing
|
||||
$wineboot -u
|
||||
|
||||
win64_sys_path=$($wine64 winepath -u 'C:\windows\system32' 2> /dev/null)
|
||||
win64_sys_path="${win64_sys_path/$'\r'/}"
|
||||
if $wow64; then
|
||||
win32_sys_path=$($wine winepath -u 'C:\windows\system32' 2> /dev/null)
|
||||
win32_sys_path="${win32_sys_path/$'\r'/}"
|
||||
fi
|
||||
|
||||
if [ -z "$win32_sys_path" ] && [ -z "$win64_sys_path" ]; then
|
||||
echo 'Failed to resolve C:\windows\system32.' >&2
|
||||
wait
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# create native dll override
|
||||
overrideDll() {
|
||||
$wine reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v $1 /d native /f >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "Failed to add override for $1"
|
||||
wait
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# remove dll override
|
||||
restoreDll() {
|
||||
$wine reg delete 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v $1 /f > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to remove override for $1"
|
||||
fi
|
||||
}
|
||||
|
||||
# copy or link dxvk dll, back up original file
|
||||
installFile() {
|
||||
dstfile="${1}/${3}.dll"
|
||||
srcfile="${basedir}/${2}/${3}.dll"
|
||||
|
||||
if [ -f "${srcfile}.so" ]; then
|
||||
srcfile="${srcfile}.so"
|
||||
fi
|
||||
|
||||
if ! [ -f "${srcfile}" ]; then
|
||||
echo "${srcfile}: File not found. Skipping." >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
if [ -f "${dstfile}" ] || [ -h "${dstfile}" ]; then
|
||||
if ! [ -f "${dstfile}.old" ]; then
|
||||
mv -v "${dstfile}" "${dstfile}.old"
|
||||
else
|
||||
rm -v "${dstfile}"
|
||||
fi
|
||||
$file_cmd "${srcfile}" "${dstfile}"
|
||||
else
|
||||
echo "${dstfile}: File not found in wine prefix" >&2
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
# remove dxvk dll, restore original file
|
||||
uninstallFile() {
|
||||
dstfile="${1}/${3}.dll"
|
||||
srcfile="${basedir}/${2}/${3}.dll"
|
||||
|
||||
if [ -f "${srcfile}.so" ]; then
|
||||
srcfile="${srcfile}.so"
|
||||
fi
|
||||
|
||||
if ! [ -f "${srcfile}" ]; then
|
||||
echo "${srcfile}: File not found. Skipping." >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! [ -f "${dstfile}" ] && ! [ -h "${dstfile}" ]; then
|
||||
echo "${dstfile}: File not found. Skipping." >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -f "${dstfile}.old" ]; then
|
||||
rm -v "${dstfile}"
|
||||
mv -v "${dstfile}.old" "${dstfile}"
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
install() {
|
||||
installFile "$win64_sys_path" "$dxvk_lib64" "$1"
|
||||
inst64_ret="$?"
|
||||
|
||||
inst32_ret=-1
|
||||
if $wow64; then
|
||||
installFile "$win32_sys_path" "$dxvk_lib32" "$1"
|
||||
inst32_ret="$?"
|
||||
fi
|
||||
|
||||
if (( ($inst32_ret == 0) || ($inst64_ret == 0) )); then
|
||||
overrideDll "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
uninstall() {
|
||||
uninstallFile "$win64_sys_path" "$dxvk_lib64" "$1"
|
||||
uninst64_ret="$?"
|
||||
|
||||
uninst32_ret=-1
|
||||
if $wow64; then
|
||||
uninstallFile "$win32_sys_path" "$dxvk_lib32" "$1"
|
||||
uninst32_ret="$?"
|
||||
fi
|
||||
|
||||
if (( ($uninst32_ret == 0) || ($uninst64_ret == 0) )); then
|
||||
restoreDll "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
# skip dxgi during install if not explicitly
|
||||
# enabled, but always try to uninstall it
|
||||
if $with_dxgi || [ "$action" == "uninstall" ]; then
|
||||
$action dxgi
|
||||
fi
|
||||
|
||||
$action d3d9
|
||||
|
||||
if $with_d3d10 || [ "$action" == "uninstall" ]; then
|
||||
$action d3d10
|
||||
$action d3d10_1
|
||||
fi
|
||||
|
||||
$action d3d10core
|
||||
$action d3d11
|
||||
wait
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"Version": "1.9.0Alpha3",
|
||||
"Version": "1.9.0",
|
||||
"Thank": [
|
||||
"感谢 @a2035274 @虚幻的早晨 https://bbs.deepin.org/post/238301",
|
||||
"感谢 @zhangs https://bbs.deepin.org/post/227948",
|
||||
@@ -12,7 +12,11 @@
|
||||
"感谢 @PossibleVing 提供的新版应用图标",
|
||||
"感谢 @zhengjl 反馈的 1.7.0 中 .net framrwork 3.5 非离线版安装包的问题以及 1.8.0 重复路径一直自动重复增加的问题",
|
||||
"感谢 @国川 @刘岐 提供的非 i386、amd64 运行 wine 使用 i386/amd64 可执行文件的教程和脚本",
|
||||
"感谢 @勇往直前 梦想启航 @189******09 @tfhyl 提供在非 X86 平台的国产 PC 进行测试",
|
||||
"感谢 @cuisirwork 提供的提供视频教程的建议",
|
||||
"感谢 @办公助手 提供的非 X86 平台 Wine 运行自定义 exe 应用教程和 deb 包",
|
||||
"感谢统信在 Wine 生态适配活动中提供的打包脚本",
|
||||
"也感谢 DXVK 的开发者开发了 DXVK 这个程序,项目链接:https://github.com/doitsujin/dxvk",
|
||||
"",
|
||||
"可以从上面的各种解决方案更好的学习 Wine 生态适配,也可以看 deepin 论坛板块 https://bbs.deepin.org/module/detail/116 进行学习,最后也向各位有进行 Wine 生态适配的大佬进行由衷的感谢!",
|
||||
"如果上面有遗漏,请向我反馈补充"
|
||||
|
||||
Binary file not shown.
1
deb/opt/apps/deepin-wine-runner/sparkstore.list
Normal file
1
deb/opt/apps/deepin-wine-runner/sparkstore.list
Normal file
@@ -0,0 +1 @@
|
||||
deb [by-hash=force] https://d.store.deepinos.org.cn /
|
||||
BIN
deb/opt/apps/deepin-wine-runner/wined3d.dll.so.7z
Normal file
BIN
deb/opt/apps/deepin-wine-runner/wined3d.dll.so.7z
Normal file
Binary file not shown.
Reference in New Issue
Block a user