mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-06-16 03:46:00 +08:00
Compare commits
6 Commits
df5d08cd68
...
55aeae22af
Author | SHA1 | Date | |
---|---|---|---|
55aeae22af | |||
1bdf8de39c | |||
8f37bfd3b8 | |||
7a175c957a | |||
6ac4a191ca | |||
9296914ed5 |
@ -15,6 +15,10 @@ import PyQt5.QtGui as QtGui
|
||||
import PyQt5.QtCore as QtCore
|
||||
import PyQt5.QtWidgets as QtWidgets
|
||||
|
||||
TMPDIR = os.getenv("TMPDIR")
|
||||
if (TMPDIR == None):
|
||||
TMPDIR = ""
|
||||
|
||||
# 获取用户主目录
|
||||
def get_home():
|
||||
return os.path.expanduser('~')
|
||||
@ -208,9 +212,9 @@ class SaveLogReport():
|
||||
traceback.print_exc()
|
||||
os.system(f"'{programPath}/wrestool' '{binPath}' -x -t 14 > '/tmp/wine-runner-log-icon.png'")
|
||||
# 如果提取成功
|
||||
if os.path.exists("/tmp/wine-runner-log-icon.png"):
|
||||
if os.path.exists(TMPDIR + "/tmp/wine-runner-log-icon.png"):
|
||||
# 转换成 base64 编码
|
||||
self.binIcon = "data:image/jpg;base64," + FileToBase64("/tmp/wine-runner-log-icon.png")
|
||||
self.binIcon = "data:image/jpg;base64," + FileToBase64(TMPDIR + "/tmp/wine-runner-log-icon.png")
|
||||
self.binIconPath = "/tmp/wine-runner-log-icon.png"
|
||||
else:
|
||||
self.binIcon = "Not Found"
|
||||
@ -317,9 +321,9 @@ class SaveLogReport():
|
||||
messagebox.exec_()
|
||||
|
||||
def To7z(self, savePath):
|
||||
os.system("rm -rfv /tmp/wine-runner-log")
|
||||
os.system("mkdir -v /tmp/wine-runner-log")
|
||||
self.ToHtml("/tmp/wine-runner-log/index.html", toZip=True)
|
||||
os.system("rm -rfv $TMPDIR/tmp/wine-runner-log")
|
||||
os.system("mkdir -v $TMPDIR/tmp/wine-runner-log")
|
||||
self.ToHtml(TMPDIR + "/tmp/wine-runner-log/index.html", toZip=True)
|
||||
if os.path.exists(self.binIconPath):
|
||||
shutil.copy(self.binIconPath, f"/tmp/wine-runner-log/{os.path.basename(self.binIconPath)}")
|
||||
lists = ["wine-runner-log-icon.png", "index.html"]
|
||||
@ -332,7 +336,7 @@ class SaveLogReport():
|
||||
else:
|
||||
lists.append(name)
|
||||
shutil.copy(i, f"/tmp/wine-runner-log/{name}")
|
||||
os.system(f"7z a '{savePath}' /tmp/wine-runner-log")
|
||||
os.system(f"7z a '{savePath}' $TMPDIR/tmp/wine-runner-log")
|
||||
|
||||
|
||||
def ToHtml(self, savePath, toZip=False):
|
||||
|
14
StartVM.sh
14
StartVM.sh
@ -12,7 +12,7 @@ CURRENT_DIR=$(cd $(dirname $0); pwd)
|
||||
VBoxManage showvminfo Windows
|
||||
if [[ 0 == $? ]]; then
|
||||
# 检测到虚拟机存在,启动虚拟机
|
||||
VBoxManage startvm Windows > /tmp/windows-virtual-machine-installer-for-wine-runner-run.log 2>&1
|
||||
VBoxManage startvm Windows > $TMPDIR/tmp/windows-virtual-machine-installer-for-wine-runner-run.log 2>&1
|
||||
exit
|
||||
fi
|
||||
# 检查是否有 QEMU
|
||||
@ -73,7 +73,7 @@ if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then
|
||||
-m ${use}G -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI \
|
||||
-device AC97 -device ES1370 -device intel-hda -device hda-duplex \
|
||||
--boot 'splash=VM/boot.jpg,menu=on,splash-time=2000' \
|
||||
> /tmp/windows-virtual-machine-installer-for-wine-runner-run.log 2>&1 # 最新的 qemu 已经移除参数 -soundhw all
|
||||
> $TMPDIR/tmp/windows-virtual-machine-installer-for-wine-runner-run.log 2>&1 # 最新的 qemu 已经移除参数 -soundhw all
|
||||
exit
|
||||
fi
|
||||
# 判断系统版本以选择 Qemu
|
||||
@ -102,7 +102,7 @@ if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then
|
||||
-m ${use}G -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI \
|
||||
-device AC97 -device ES1370 -device intel-hda -device hda-duplex \
|
||||
--boot 'splash=VM/boot.jpg,menu=on,splash-time=2000' \
|
||||
> /tmp/windows-virtual-machine-installer-for-wine-runner-run.log 2>&1 # 最新的 qemu 已经移除参数 -soundhw all
|
||||
> $TMPDIR/tmp/windows-virtual-machine-installer-for-wine-runner-run.log 2>&1 # 最新的 qemu 已经移除参数 -soundhw all
|
||||
exit
|
||||
fi
|
||||
cat ~/.config/deepin-wine-runner/QEMU-ARCH | grep armhf
|
||||
@ -128,7 +128,7 @@ if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then
|
||||
-device usb-kbd,id=keyboard,bus=xhci.0,port=2 \
|
||||
-device AC97 -device ES1370 -device intel-hda -device hda-duplex \
|
||||
--boot 'splash=VM/boot.jpg,menu=on,splash-time=2000' \
|
||||
> /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 # 最新的 qemu 已经移除参数 -soundhw all
|
||||
> $TMPDIR/tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 # 最新的 qemu 已经移除参数 -soundhw all
|
||||
exit
|
||||
fi
|
||||
$qemuMore qemu-system-arm --hda "$HOME/Qemu/Windows/Windows.qcow2" \
|
||||
@ -140,7 +140,7 @@ if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then
|
||||
-device usb-kbd,id=keyboard,bus=xhci.0,port=2 \
|
||||
-device AC97 -device ES1370 -device intel-hda -device hda-duplex \
|
||||
--boot 'splash=VM/boot.jpg,menu=on,splash-time=2000' \
|
||||
> /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 # 最新的 qemu 已经移除参数 -soundhw all
|
||||
> $TMPDIR/tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 # 最新的 qemu 已经移除参数 -soundhw all
|
||||
exit
|
||||
fi
|
||||
cat ~/.config/deepin-wine-runner/QEMU-ARCH | grep aarch64
|
||||
@ -167,7 +167,7 @@ if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then
|
||||
-device usb-kbd,id=keyboard,bus=xhci.0,port=2 \
|
||||
-device AC97 -device ES1370 -device intel-hda -device hda-duplex \
|
||||
--boot 'splash=VM/boot.jpg,menu=on,splash-time=2000' \
|
||||
> /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 # 最新的 qemu 已经移除参数 -soundhw all
|
||||
> $TMPDIR/tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 # 最新的 qemu 已经移除参数 -soundhw all
|
||||
exit
|
||||
fi
|
||||
$qemuMore qemu-system-aarch64 --hda "$HOME/Qemu/Windows/Windows.qcow2" \
|
||||
@ -180,7 +180,7 @@ if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then
|
||||
-device usb-kbd,id=keyboard,bus=xhci.0,port=2 \
|
||||
-device AC97 -device ES1370 -device intel-hda -device hda-duplex \
|
||||
--boot 'splash=VM/boot.jpg,menu=on,splash-time=2000' \
|
||||
> /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 # 最新的 qemu 已经移除参数 -soundhw all
|
||||
> $TMPDIR/tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 # 最新的 qemu 已经移除参数 -soundhw all
|
||||
exit
|
||||
fi
|
||||
|
||||
|
@ -6,15 +6,15 @@ echo ' # # #"""" #"""" #"# '
|
||||
echo ' "mmm" "#mm" "#mm" # "m '
|
||||
echo
|
||||
echo
|
||||
cd /tmp
|
||||
cd $TMPDIR/tmp
|
||||
echo 提示:
|
||||
echo Geek Uninstaller 官网访问较慢,所以请耐心等待
|
||||
aria2c -x 16 -s 16 https://geekuninstaller.com/geek.zip
|
||||
unzip geek.zip
|
||||
cd `dirname $0`
|
||||
cp -rv /tmp/geek.exe ./
|
||||
cp -rv $TMPDIR/tmp/geek.exe ./
|
||||
if [[ $? == 0 ]];then
|
||||
exit
|
||||
fi
|
||||
echo "拷贝失败,申请使用 sudo 拷贝"
|
||||
sudo cp -rv /tmp/geek.exe ./
|
||||
sudo cp -rv $TMPDIR/tmp/geek.exe ./
|
@ -45,9 +45,9 @@ Recommends: winbind,
|
||||
deepin-wine8-stable | spark-wine | spark-wine9 | spark-wine9-wow | spark-wine8 | spark-wine8-wow | spark-wine7-devel | deepin-wine6-stable | deepin-wine5-stable | deepin-wine5 | deepin-wine | wine,
|
||||
spark-dwine-helper | store.spark-app.spark-dwine-helper | deepin-wine-helper | com.wine-helper.deepin
|
||||
Section: utils
|
||||
Conflicts: spark.deepin-venturi-setter, spark-deepin-wine5-application-packer, spark-deepin-wine-runner-52
|
||||
Replaces: spark.deepin-venturi-setter, spark-deepin-wine5-application-packer, spark-deepin-wine-runner-52
|
||||
Provides: spark.deepin-venturi-setter, spark-deepin-wine5-application-packer, spark-deepin-wine-runner-52
|
||||
Conflicts: spark.deepin-venturi-setter, spark-deepin-wine5-application-packer, spark-deepin-wine-runner-52, spark-deepin-wine-runner-termux, termux-exec
|
||||
Replaces: spark.deepin-venturi-setter, spark-deepin-wine5-application-packer, spark-deepin-wine-runner-52, spark-deepin-wine-runner-termux
|
||||
Provides: spark.deepin-venturi-setter, spark-deepin-wine5-application-packer, spark-deepin-wine-runner-52, spark-deepin-wine-runner-termux
|
||||
Installed-Size: @@SIZE@@
|
||||
Description: Wine运行器是一个能让Linux用户更加方便地运行Windows应用的程序。原版的 Wine 只能使用命令操作,且安装过程较为繁琐,对小白不友好。于是该运行器为了解决该痛点,内置了对Wine图形化的支持、Wine 安装器、微型应用商店、各种Wine工具、自制的Wine程序打包器、运行库安装工具等。
|
||||
它同时还内置了基于Qemu/VirtualBox制作的、专供小白使用的Windows虚拟机安装工具,可以做到只需下载系统镜像并点击安装即可,无需考虑虚拟机的安装、创建、分区等操作,也能在非 X86 架构安装 X86 架构的 Windows 操作系统(但是效率较低,可以运行些老系统)。
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"Version": "3.9.2",
|
||||
"Version": "4.0.0",
|
||||
"Time": "未知",
|
||||
"Thank": [
|
||||
"感谢 @り哥拽的冇气质° 和 @杨 提供了 3a5000(新世界的测试机器)",
|
||||
|
@ -1,14 +1,24 @@
|
||||
#!/data/data/com.termux/files/usr/bin/bash
|
||||
CURRENT_DIR=$(cd $(dirname $0); pwd)
|
||||
CURRENT_DIR=$(dirname $(readlink -f "$0"))
|
||||
if [[ ! -d $TMPDIR/tmp ]]; then
|
||||
mkdir -p $TMPDIR/tmp
|
||||
fi
|
||||
noVNCOption="--vnc localhost:5901"
|
||||
VNCServerOption="-localhost yes"
|
||||
if [[ -f $HOME/.config/deepin-wine-runner/vnc-public ]]; then
|
||||
unset noVNCOption
|
||||
unset VNCServerOption
|
||||
fi
|
||||
if [[ $DISPLAY == "" ]] && [[ $WAYLAND_DISPLAY == "" ]]; then
|
||||
# 自动配置 NoVNC
|
||||
export DISPLAY=:5
|
||||
vncserver $DISPLAY &
|
||||
vncserver -kill :5
|
||||
vncserver $DISPLAY $VNCServerOption &
|
||||
sleep 3
|
||||
xfwm4 &
|
||||
if [[ -f /data/data/com.termux/files/usr/bin/startxfce4 ]]; then
|
||||
startxfce4 &
|
||||
fi
|
||||
$CURRENT_DIR/novnc/utils/novnc_proxy --vnc localhost:5905 &
|
||||
$CURRENT_DIR/novnc/utils/novnc_proxy --vnc localhost:5905 $noVNCOption &
|
||||
fi
|
||||
python3 $CURRENT_DIR/mainwindow.py
|
||||
|
144
mainwindow.py
144
mainwindow.py
@ -62,6 +62,10 @@ if sys.version_info[0] < 3:
|
||||
if sys.version_info[1] < 6:
|
||||
PythonLower()
|
||||
|
||||
TMPDIR = os.getenv("TMPDIR")
|
||||
if (TMPDIR == None):
|
||||
TMPDIR = ""
|
||||
|
||||
###################
|
||||
# 程序所需事件
|
||||
###################
|
||||
@ -1273,12 +1277,17 @@ class UpdateWindow():
|
||||
UpdateWindow.update.show()
|
||||
|
||||
def Update():
|
||||
if os.path.exists("/tmp/spark-deepin-wine-runner/update"):
|
||||
shutil.rmtree("/tmp/spark-deepin-wine-runner/update")
|
||||
os.makedirs("/tmp/spark-deepin-wine-runner/update")
|
||||
if os.path.exists(TMPDIR + "/tmp/spark-deepin-wine-runner/update"):
|
||||
shutil.rmtree(TMPDIR + "/tmp/spark-deepin-wine-runner/update")
|
||||
os.makedirs(TMPDIR + "/tmp/spark-deepin-wine-runner/update")
|
||||
unPackageNew = False
|
||||
isArch = False
|
||||
isFedora = False
|
||||
isTermux = False
|
||||
if os.path.exists("/data/data/com.termux/files"):
|
||||
isTermux = True
|
||||
if UpdateWindow.data["Url-termux"][0] == None:
|
||||
unPackageNew = True
|
||||
if os.path.exists("/etc/arch-release"):
|
||||
isArch = True
|
||||
if UpdateWindow.data["Url-pkg"][0] == None:
|
||||
@ -1287,73 +1296,92 @@ class UpdateWindow():
|
||||
isFedora = True
|
||||
if UpdateWindow.data["Url-rpm"][0] == None:
|
||||
unPackageNew = True
|
||||
if programPath != "/opt/apps/deepin-wine-runner" and programPath != "/data/data/com.termux/files/usr/opt/apps/deepin-wine-runner":
|
||||
unPackageNew = True
|
||||
try:
|
||||
print(UpdateWindow.data["Url"])
|
||||
if os.path.exists(f"{programPath}/off-line.lock") or programPath != "/opt/apps/deepin-wine-runner" or unPackageNew:
|
||||
if os.path.exists(f"{programPath}/off-line.lock") or unPackageNew:
|
||||
# 使用解压法更新
|
||||
write_txt("/tmp/spark-deepin-wine-runner/update.sh", f"""#!/bin/bash
|
||||
write_txt(TMPDIR + "/tmp/spark-deepin-wine-runner/update.sh", f"""#!/bin/bash
|
||||
echo 删除多余的安装包
|
||||
rm -rfv /tmp/spark-deepin-wine-runner/update/*
|
||||
rm -rfv $TMPDIR/tmp/spark-deepin-wine-runner/update/*
|
||||
echo 关闭“Wine 运行器”
|
||||
python3 "{programPath}/updatekiller.py"
|
||||
echo 下载安装包
|
||||
wget -P /tmp/spark-deepin-wine-runner/update {UpdateWindow.data["Url"][0]}
|
||||
wget -P $TMPDIR/tmp/spark-deepin-wine-runner/update {UpdateWindow.data["Url"][0]}
|
||||
echo 安装安装包
|
||||
cd /tmp/spark-deepin-wine-runner/update
|
||||
cd $TMPDIR/tmp/spark-deepin-wine-runner/update
|
||||
7z x *.deb
|
||||
7z x data.tar
|
||||
cp opt/apps/deepin-wine-runner/* "{programPath}" -rv
|
||||
notify-send -i "{iconPath}" "更新完毕!"
|
||||
zenity --info --text=\"更新完毕!\" --ellipsize
|
||||
""")
|
||||
OpenTerminal("bash /tmp/spark-deepin-wine-runner/update.sh")
|
||||
OpenTerminal("bash $TMPDIR/tmp/spark-deepin-wine-runner/update.sh")
|
||||
return
|
||||
else:
|
||||
if isArch:
|
||||
# 使用 pacman 安装更新
|
||||
write_txt("/tmp/spark-deepin-wine-runner/update.sh", f"""#!/bin/bash
|
||||
write_txt(TMPDIR + "/tmp/spark-deepin-wine-runner/update.sh", f"""#!/bin/bash
|
||||
echo 删除多余的安装包
|
||||
rm -rfv /tmp/spark-deepin-wine-runner/update/*
|
||||
rm -rfv $TMPDIR/tmp/spark-deepin-wine-runner/update/*
|
||||
echo 关闭“Wine 运行器”
|
||||
python3 "{programPath}/updatekiller.py"
|
||||
echo 下载安装包
|
||||
wget -P /tmp/spark-deepin-wine-runner/update {UpdateWindow.data["Url-pkg"][0]}
|
||||
wget -P $TMPDIR/tmp/spark-deepin-wine-runner/update {UpdateWindow.data["Url-pkg"][0]}
|
||||
echo 安装安装包
|
||||
pacman -U /tmp/spark-deepin-wine-runner/update/* --noconfirm
|
||||
pacman -U $TMPDIR/tmp/spark-deepin-wine-runner/update/* --noconfirm
|
||||
notify-send -i "{iconPath}" "更新完毕!"
|
||||
zenity --info --text=\"更新完毕!\" --ellipsize
|
||||
""")
|
||||
elif isFedora:
|
||||
# 使用 yum 安装更新
|
||||
write_txt("/tmp/spark-deepin-wine-runner/update.sh", f"""#!/bin/bash
|
||||
write_txt(TMPDIR + "/tmp/spark-deepin-wine-runner/update.sh", f"""#!/bin/bash
|
||||
echo 删除多余的安装包
|
||||
rm -rfv /tmp/spark-deepin-wine-runner/update/*
|
||||
rm -rfv $TMPDIR/tmp/spark-deepin-wine-runner/update/*
|
||||
echo 关闭“Wine 运行器”
|
||||
python3 "{programPath}/updatekiller.py"
|
||||
echo 下载安装包
|
||||
wget -O /tmp/spark-deepin-wine-runner/update/spark-deepin-wine-runner.rpm {UpdateWindow.data["Url-rpm"][0]}
|
||||
wget -O $TMPDIR/tmp/spark-deepin-wine-runner/update/spark-deepin-wine-runner.rpm {UpdateWindow.data["Url-rpm"][0]}
|
||||
echo 安装安装包
|
||||
yum reinstall /tmp/spark-deepin-wine-runner/update/spark-deepin-wine-runner.rpm -y
|
||||
yum reinstall $TMPDIR/tmp/spark-deepin-wine-runner/update/spark-deepin-wine-runner.rpm -y
|
||||
notify-send -i "{iconPath}" "更新完毕!"
|
||||
zenity --info --text=\"更新完毕!\" --ellipsize
|
||||
""")
|
||||
elif isTermux:
|
||||
# 使用 pkg 安装更新
|
||||
write_txt(TMPDIR + "/tmp/spark-deepin-wine-runner/update.sh", f"""#!/data/data/com.termux/files/usr/bin/bash
|
||||
echo 删除多余的安装包
|
||||
rm -rfv $TMPDIR/tmp/spark-deepin-wine-runner/update/*
|
||||
echo 关闭“Wine 运行器”
|
||||
python3 "{programPath}/updatekiller.py"
|
||||
echo 下载安装包
|
||||
wget -O $TMPDIR/tmp/spark-deepin-wine-runner/update/spark-deepin-wine-runner-termux.deb {UpdateWindow.data["Url-termux"][0]}
|
||||
echo 安装安装包
|
||||
pkg reinstall $TMPDIR/tmp/spark-deepin-wine-runner/update/spark-deepin-wine-runner.rpm -y
|
||||
notify-send -i "{iconPath}" "更新完毕!"
|
||||
zenity --info --text=\"更新完毕!\" --ellipsize
|
||||
""")
|
||||
else:
|
||||
# 使用 deb 安装更新
|
||||
write_txt("/tmp/spark-deepin-wine-runner/update.sh", f"""#!/bin/bash
|
||||
write_txt(TMPDIR + "/tmp/spark-deepin-wine-runner/update.sh", f"""#!/bin/bash
|
||||
echo 删除多余的安装包
|
||||
rm -rfv /tmp/spark-deepin-wine-runner/update/*
|
||||
rm -rfv $TMPDIR/tmp/spark-deepin-wine-runner/update/*
|
||||
echo 关闭“Wine 运行器”
|
||||
python3 "{programPath}/updatekiller.py"
|
||||
echo 下载安装包
|
||||
wget -P /tmp/spark-deepin-wine-runner/update {UpdateWindow.data["Url"][0]}
|
||||
wget -P $TMPDIR/tmp/spark-deepin-wine-runner/update {UpdateWindow.data["Url"][0]}
|
||||
echo 安装安装包
|
||||
dpkg -i /tmp/spark-deepin-wine-runner/update/*
|
||||
dpkg -i $TMPDIR/tmp/spark-deepin-wine-runner/update/*
|
||||
echo 修复依赖关系
|
||||
apt install -f -y
|
||||
notify-send -i "{iconPath}" "更新完毕!"
|
||||
zenity --info --text=\"更新完毕!\" --ellipsize
|
||||
""")
|
||||
OpenTerminal("pkexec bash /tmp/spark-deepin-wine-runner/update.sh")
|
||||
if isTermux:
|
||||
OpenTerminal("bash $TMPDIR/tmp/spark-deepin-wine-runner/update.sh")
|
||||
else:
|
||||
OpenTerminal("pkexec bash $TMPDIR/tmp/spark-deepin-wine-runner/update.sh")
|
||||
except:
|
||||
traceback.print_exc()
|
||||
QtWidgets.QMessageBox.critical(None, "出现错误,无法继续更新", traceback.format_exc())
|
||||
@ -1472,29 +1500,29 @@ class GetDllFromWindowsISO:
|
||||
# 显示所有内容
|
||||
# 下面内容需要分类讨论
|
||||
if GetDllFromWindowsISO.arch == 0:
|
||||
for i in os.listdir("/tmp/wine-runner-getdll/i386"):
|
||||
for i in os.listdir(TMPDIR + "/tmp/wine-runner-getdll/i386"):
|
||||
if i[-3:] == "dl_":
|
||||
findList.append(i[:-1] + "l")
|
||||
elif GetDllFromWindowsISO.arch == 32:
|
||||
for i in os.listdir("/tmp/wine-runner-getdll-wim/Windows/SysWOW64"):
|
||||
for i in os.listdir(TMPDIR + "/tmp/wine-runner-getdll-wim/Windows/SysWOW64"):
|
||||
if i[-3:] == "dll":
|
||||
findList.append(i[:-1] + "l")
|
||||
elif GetDllFromWindowsISO.arch == 64:
|
||||
for i in os.listdir("/tmp/wine-runner-getdll-wim/Windows/System32"):
|
||||
for i in os.listdir(TMPDIR + "/tmp/wine-runner-getdll-wim/Windows/System32"):
|
||||
if i[-3:] == "dll":
|
||||
findList.append(i[:-1] + "l")
|
||||
GetDllFromWindowsISO.dllListModel.setStringList(findList)
|
||||
return
|
||||
if GetDllFromWindowsISO.arch == 0:
|
||||
for i in os.listdir("/tmp/wine-runner-getdll/i386"):
|
||||
for i in os.listdir(TMPDIR + "/tmp/wine-runner-getdll/i386"):
|
||||
if found in i[:-1] + "l":
|
||||
findList.append(i[:-1] + "l")
|
||||
elif GetDllFromWindowsISO.arch == 32:
|
||||
for i in os.listdir("/tmp/wine-runner-getdll-wim/Windows/SysWOW64"):
|
||||
for i in os.listdir(TMPDIR + "/tmp/wine-runner-getdll-wim/Windows/SysWOW64"):
|
||||
if found in i[:-1] + "l":
|
||||
findList.append(i[:-1] + "l")
|
||||
elif GetDllFromWindowsISO.arch == 64:
|
||||
for i in os.listdir("/tmp/wine-runner-getdll-wim/Windows/System32"):
|
||||
for i in os.listdir(TMPDIR + "/tmp/wine-runner-getdll-wim/Windows/System32"):
|
||||
if found in i[:-1] + "l":
|
||||
findList.append(i[:-1] + "l")
|
||||
if len(isoPath) == 0:
|
||||
@ -1513,27 +1541,27 @@ class GetDllFromWindowsISO:
|
||||
if not os.path.exists(GetDllFromWindowsISO.isoPath.currentText()):
|
||||
QtWidgets.QMessageBox.critical(GetDllFromWindowsISO.message, transla.trans("错误"), transla.trans("您选择的 ISO 镜像文件不存在"))
|
||||
return
|
||||
if os.path.exists("/tmp/wine-runner-getdll"):
|
||||
if os.path.exists(TMPDIR + "/tmp/wine-runner-getdll"):
|
||||
try:
|
||||
os.rmdir("/tmp/wine-runner-getdll")
|
||||
os.system("rm -rf /tmp/wine-runner-getdll-wim")
|
||||
os.rmdir(TMPDIR + "/tmp/wine-runner-getdll")
|
||||
os.system("rm -rf $TMPDIR/tmp/wine-runner-getdll-wim")
|
||||
except:
|
||||
# 如果无法删除可能是挂载了文件
|
||||
os.system("wimunmount /tmp/wine-runner-getdll-wim")
|
||||
os.system("pkexec umount /tmp/wine-runner-getdll")
|
||||
os.system("wimunmount $TMPDIR/tmp/wine-runner-getdll-wim")
|
||||
os.system("pkexec umount $TMPDIR/tmp/wine-runner-getdll")
|
||||
|
||||
try:
|
||||
os.rmdir("/tmp/wine-runner-getdll")
|
||||
os.rmdir("/tmp/wine-runner-getdll-wim")
|
||||
os.rmdir(TMPDIR + "/tmp/wine-runner-getdll")
|
||||
os.rmdir(TMPDIR + "/tmp/wine-runner-getdll-wim")
|
||||
except:
|
||||
traceback.print_exc()
|
||||
QtWidgets.QMessageBox.critical(GetDllFromWindowsISO.message, "错误", traceback.format_exc())
|
||||
return
|
||||
os.makedirs("/tmp/wine-runner-getdll")
|
||||
os.system(f"pkexec mount '{GetDllFromWindowsISO.isoPath.currentText()}' /tmp/wine-runner-getdll")
|
||||
os.makedirs(TMPDIR + "/tmp/wine-runner-getdll")
|
||||
os.system(f"pkexec mount '{GetDllFromWindowsISO.isoPath.currentText()}' $TMPDIR/tmp/wine-runner-getdll")
|
||||
findList = []
|
||||
# 判断是新版的 Windows ISO(Windows Vista 及以上版本)
|
||||
if os.path.exists("/tmp/wine-runner-getdll/sources/install.wim"):
|
||||
if os.path.exists(TMPDIR + "/tmp/wine-runner-getdll/sources/install.wim"):
|
||||
# 如果没有安装 wimtools 的话
|
||||
if os.system("which wimmount") != 0:
|
||||
QtWidgets.QMessageBox.critical(GetDllFromWindowsISO.message, "错误", f"镜像内容读取/挂载失败,因为没有安装 wimtools 以至无法读取")
|
||||
@ -1544,14 +1572,14 @@ class GetDllFromWindowsISO:
|
||||
choose = QtWidgets.QInputDialog.getInt(GetDllFromWindowsISO.message, "提示", "请输入 Index")
|
||||
if not choose[1]:
|
||||
return
|
||||
os.makedirs("/tmp/wine-runner-getdll-wim")
|
||||
os.system(f"wimmount /tmp/wine-runner-getdll/sources/install.wim {choose[0]} /tmp/wine-runner-getdll-wim")
|
||||
if os.path.exists("/tmp/wine-runner-getdll-wim/Windows/SysWOW64"):
|
||||
os.makedirs(TMPDIR + "/tmp/wine-runner-getdll-wim")
|
||||
os.system(f"wimmount $TMPDIR/tmp/wine-runner-getdll/sources/install.wim {choose[0]} $TMPDIR/tmp/wine-runner-getdll-wim")
|
||||
if os.path.exists(TMPDIR + "/tmp/wine-runner-getdll-wim/Windows/SysWOW64"):
|
||||
# 如果是 64 位镜像
|
||||
if QtWidgets.QInputDialog.getItem(GetDllFromWindowsISO.message, "选择位数", "选择位数(如果没有选择,默认为 64 位)", ["32", "64"], 1, False) == "32":
|
||||
# 64 位镜像的 32 位是存在 SysWOW64 的
|
||||
try:
|
||||
for i in os.listdir("/tmp/wine-runner-getdll-wim/Windows/SysWOW64"):
|
||||
for i in os.listdir(TMPDIR + "/tmp/wine-runner-getdll-wim/Windows/SysWOW64"):
|
||||
if i[-3:] == "dll":
|
||||
findList.append(i[:-1] + "l")
|
||||
GetDllFromWindowsISO.dllListModel.setStringList(findList)
|
||||
@ -1570,7 +1598,7 @@ class GetDllFromWindowsISO:
|
||||
QtWidgets.QMessageBox.critical(GetDllFromWindowsISO.message, "错误", f"镜像内容读取/挂载失败,报错如下:\n{traceback.format_exc()}")
|
||||
return
|
||||
try:
|
||||
for i in os.listdir("/tmp/wine-runner-getdll-wim/Windows/System32"):
|
||||
for i in os.listdir(TMPDIR + "/tmp/wine-runner-getdll-wim/Windows/System32"):
|
||||
if i[-3:] == "dll":
|
||||
findList.append(i[:-1] + "l")
|
||||
GetDllFromWindowsISO.arch = 64
|
||||
@ -1581,7 +1609,7 @@ class GetDllFromWindowsISO:
|
||||
GetDllFromWindowsISO.dllListModel.setStringList(findList)
|
||||
else:
|
||||
try:
|
||||
for i in os.listdir("/tmp/wine-runner-getdll/i386"):
|
||||
for i in os.listdir(TMPDIR + "/tmp/wine-runner-getdll/i386"):
|
||||
if i[-3:] == "dl_":
|
||||
findList.append(i[:-1] + "l")
|
||||
GetDllFromWindowsISO.arch = 0
|
||||
@ -1601,11 +1629,11 @@ class GetDllFromWindowsISO:
|
||||
#GetDllFromWindowsISO.isoPath['value'] = isoPath
|
||||
|
||||
def UmountDisk():
|
||||
os.system("wimunmount /tmp/wine-runner-getdll-wim")
|
||||
os.system("pkexec umount /tmp/wine-runner-getdll")
|
||||
os.system("wimunmount $TMPDIR/tmp/wine-runner-getdll-wim")
|
||||
os.system("pkexec umount $TMPDIR/tmp/wine-runner-getdll")
|
||||
try:
|
||||
shutil.rmtree("/tmp/wine-runner-getdll")
|
||||
os.system("rm -rf /tmp/wine-runner-getdll-wim")
|
||||
shutil.rmtree(TMPDIR + "/tmp/wine-runner-getdll")
|
||||
os.system("rm -rf $TMPDIR/tmp/wine-runner-getdll-wim")
|
||||
except:
|
||||
traceback.print_exc()
|
||||
QtWidgets.QMessageBox.critical(GetDllFromWindowsISO.message, QtCore.QCoreApplication.translate("U", "错误"), f"关闭/卸载镜像失败,报错如下:\n{traceback.format_exc()}")
|
||||
@ -1623,11 +1651,11 @@ class GetDllFromWindowsISO:
|
||||
try:
|
||||
# 要分类讨论
|
||||
if GetDllFromWindowsISO.arch == 0:
|
||||
shutil.copy(f"/tmp/wine-runner-getdll/i386/{choose[:-1]}_", f"{GetDllFromWindowsISO.wineBottonPath}/drive_c/windows/system32/{choose}")
|
||||
shutil.copy(TMPDIR + f"/tmp/wine-runner-getdll/i386/{choose[:-1]}_", f"{GetDllFromWindowsISO.wineBottonPath}/drive_c/windows/system32/{choose}")
|
||||
elif GetDllFromWindowsISO.arch == 32:
|
||||
shutil.copy(f"/tmp/wine-runner-getdll-wim/Windows/SysWOW64/{choose[:-1]}l", f"{GetDllFromWindowsISO.wineBottonPath}/drive_c/windows/system32/{choose}")
|
||||
shutil.copy(TMPDIR + f"/tmp/wine-runner-getdll-wim/Windows/SysWOW64/{choose[:-1]}l", f"{GetDllFromWindowsISO.wineBottonPath}/drive_c/windows/system32/{choose}")
|
||||
elif GetDllFromWindowsISO.arch == 64:
|
||||
shutil.copy(f"/tmp/wine-runner-getdll-wim/Windows/System32/{choose[:-1]}l", f"{GetDllFromWindowsISO.wineBottonPath}/drive_c/windows/system32/{choose}")
|
||||
shutil.copy(TMPDIR + f"/tmp/wine-runner-getdll-wim/Windows/System32/{choose[:-1]}l", f"{GetDllFromWindowsISO.wineBottonPath}/drive_c/windows/system32/{choose}")
|
||||
# 选择原装或优于内建
|
||||
if QtWidgets.QInputDialog.getItem(GetDllFromWindowsISO.message, "选择", "选择模式", ["原装先于内建", "原装"], 0, False) == "原装先于内建":
|
||||
# 原装先于内建
|
||||
@ -2480,12 +2508,14 @@ updateThingsString = QtCore.QCoreApplication.translate("U", '''※1、优化运
|
||||
※5、跟进 dxvk 2.4
|
||||
※6、修复 deepin 23 无法使用 Mono/Gecko 安装器的问题
|
||||
※7、修复 debian testing 打包时会把 / 打入 .7z 包内导致系统死机的问题
|
||||
8、修复虚拟机启动器入口不会调用安装的 Qemu Extra 的问题
|
||||
9、优化高级打包器容器名称生成机制
|
||||
※8、支持 AOSC(安同)、小小电脑、proot 容器
|
||||
※9、支持在 Termux 直接运行
|
||||
10、修复虚拟机启动器入口不会调用安装的 Qemu Extra 的问题
|
||||
11、优化高级打包器容器名称生成机制
|
||||
''')
|
||||
for i in information["Thank"]:
|
||||
thankText += f"{i}\n"
|
||||
updateTime = "2024年06月29日"
|
||||
updateTime = "2024年07月21日"
|
||||
aboutProgram = QtCore.QCoreApplication.translate("U", """<p>Wine运行器是一个能让Linux用户更加方便地运行Windows应用的程序。原版的 Wine 只能使用命令操作,且安装过程较为繁琐,对小白不友好。于是该运行器为了解决该痛点,内置了对Wine图形化的支持、Wine 安装器、微型应用商店、各种Wine工具、自制的Wine程序打包器、运行库安装工具等。</p>
|
||||
<p>它同时还内置了基于Qemu/VirtualBox制作的、专供小白使用的Windows虚拟机安装工具,可以做到只需下载系统镜像并点击安装即可,无需考虑虚拟机的安装、创建、分区等操作,也能在非 X86 架构安装 X86 架构的 Windows 操作系统(但是效率较低,可以运行些老系统)。</p>
|
||||
<p>而且对于部分 Wine 应用适配者来说,提供了图形化的打包工具,以及提供了一些常用工具以及运行库的安装方式,以及能安装多种不同的 Wine 以测试效果,能极大提升适配效率。</p>
|
||||
@ -2593,13 +2623,13 @@ for i in iconListUnBuild:
|
||||
print(iconList)
|
||||
# Qemu Lock
|
||||
try:
|
||||
if os.path.exists("/tmp/deepin-wine-runner-lock.txt"):
|
||||
if os.path.exists(TMPDIR + "/tmp/deepin-wine-runner-lock.txt"):
|
||||
print("lock")
|
||||
with open(f"/tmp/deepin-wine-runner-lock.txt", "r") as file:
|
||||
with open(TMPDIR + f"/tmp/deepin-wine-runner-lock.txt", "r") as file:
|
||||
setting["QemuUnMountHome"] = bool(int(file.read()))
|
||||
else:
|
||||
print("unlock")
|
||||
with open(f"/tmp/deepin-wine-runner-lock.txt", "w") as file:
|
||||
with open(TMPDIR + f"/tmp/deepin-wine-runner-lock.txt", "w") as file:
|
||||
# = bool(int(file.read()))
|
||||
file.write(str(int(setting["QemuUnMountHome"])))
|
||||
except:
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"Version": "3.9.2",
|
||||
"Version": "4.0.0",
|
||||
"Time": "未知",
|
||||
"Thank": [
|
||||
"感谢 @り哥拽的冇气质° 和 @杨 提供了 3a5000(新世界的测试机器)",
|
||||
|
@ -3,7 +3,10 @@ import sys
|
||||
import os
|
||||
import atexit
|
||||
|
||||
PIDFILE = '/tmp/deepin-wine-runner.pid'
|
||||
TMPDIR = os.getenv("TMPDIR")
|
||||
if (TMPDIR == None):
|
||||
TMPDIR = ""
|
||||
PIDFILE = TMPDIR + '/tmp/deepin-wine-runner.pid'
|
||||
|
||||
#程序结束时清理pid
|
||||
@atexit.register
|
||||
|
@ -210,6 +210,7 @@ class GetInfo():
|
||||
isLoongarch = (arch == "loong64") or (arch == "loongarch64")
|
||||
isProot = os.path.exists("/storage")
|
||||
isAndroid = os.path.exists("/data")
|
||||
isTermux = os.path.exists("/data")
|
||||
glibcVersion = "2.28"
|
||||
|
||||
def __init__(self):
|
||||
@ -321,6 +322,8 @@ class GetInfo():
|
||||
result = True
|
||||
if (data == "android" and self.isAndroid):
|
||||
result = True
|
||||
if (data == "termux" and self.isTermux):
|
||||
result = True
|
||||
if (self.compareVersion(self.glibcVersion, data) == 1):
|
||||
result = True
|
||||
if (os.path.exists(data)):
|
||||
@ -365,12 +368,15 @@ def ReadInternetInformation():
|
||||
QtWidgets.QMessageBox.critical(window, "错误", "无法连接服务器!")
|
||||
return
|
||||
nmodel = QtGui.QStandardItemModel(window)
|
||||
newinternetJsonList = []
|
||||
for i in internetJsonList:
|
||||
if (ui.m_recommendWine.isChecked() and not systemInfo.check(i[2])):
|
||||
continue
|
||||
item = QtGui.QStandardItem(i[0])
|
||||
nmodel.appendRow(item)
|
||||
newinternetJsonList.append(i)
|
||||
ui.internetWineList.setModel(nmodel)
|
||||
internetJsonList = newinternetJsonList
|
||||
|
||||
class DownloadThread(QtCore.QThread):
|
||||
MessageBoxInfo = QtCore.pyqtSignal(str)
|
||||
|
Loading…
x
Reference in New Issue
Block a user