mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-06-12 18:06:00 +08:00
change
This commit is contained in:
parent
94023ddb24
commit
6b406a3c2c
Binary file not shown.
@ -19,10 +19,10 @@ try:
|
||||
"https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/vscpp/list.json",
|
||||
"http://gfdgdxi.msns.cn/wine-runner-list/vscpp/list.json"
|
||||
]
|
||||
netList = json.loads(requests.get().text)
|
||||
netList = json.loads(requests.get(sourcesList[0]).text)
|
||||
except:
|
||||
netList = [
|
||||
["VC6 运行库", "https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/vscpp/VC6RedistSetup_deu.exe"],
|
||||
["VC6 运行库", "https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/vscpp/VC6RedistSetup_deu.exe", "VC6RedistSetup_deu.exe"],
|
||||
["2005 Service Pack 1 Redistributable Package MFC 安全更新", "https://download.microsoft.com/download/4/A/2/4A22001F-FA3B-4C13-BF4E-42EC249D51C4/vcredist_x86.EXE", "vcredist05_x86.exe"],
|
||||
["2008 (VC++ 9.0) SP1 (不再支持) X86", "https://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_x86.exe", "vcredist08_x86.exe"],
|
||||
["2008 (VC++ 9.0) SP1 (不再支持) X64", "https://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_x64.exe", "vcredist08_x86.exe"],
|
||||
|
@ -43,5 +43,12 @@ else
|
||||
fi
|
||||
# 挂载此内容以可以跨架构运行程序
|
||||
mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
|
||||
# 判断是否有 Root 权限
|
||||
cat etc/sudoers | grep "$2"
|
||||
if [[ $? != 0 ]]; then
|
||||
echo "$2 ALL=(ALL:ALL) ALL" >> etc/sudoers
|
||||
fi
|
||||
# 写入 DNS
|
||||
cat /etc/resolv.conf > etc/resolv.conf
|
||||
# 如果参数 3 存在
|
||||
"$programPath/pardus-chroot" "--userspec=$2:$2" . env "HOME=/home/$2" ${@:3}
|
||||
|
Binary file not shown.
@ -76,9 +76,9 @@ def disabled_or_NORMAL_all(choose):
|
||||
buildDebDir.setDisabled(choose)
|
||||
debDepends.setDisabled(choose)
|
||||
debRecommend.setDisabled(choose)
|
||||
if not choose:
|
||||
ChangeArchCombobox()
|
||||
ChangeWine()
|
||||
#if not choose:
|
||||
# ChangeArchCombobox()
|
||||
# ChangeWine()
|
||||
|
||||
class QT:
|
||||
thread = None
|
||||
@ -154,29 +154,46 @@ def Build7z(b, self, debInformation, debPackagePath):
|
||||
# 设置容器
|
||||
###############
|
||||
self.label.emit("正在设置 wine 容器")
|
||||
if e6_text.text()[-3: ] != ".7z":
|
||||
if e6_text.text()[-3: ] != ".7z" and debArch.currentIndex() != 2:
|
||||
os.chdir(programPath)
|
||||
if cleanBottonByUOS.isChecked():
|
||||
self.run_command(f"WINE='{debInformation[debArch.currentIndex()]['Wine']}' '{programPath}/cleanbottle.sh' '{b}'")
|
||||
os.chdir(b)
|
||||
# 对用户目录进行处理
|
||||
self.run_command("sed -i \"s#$USER#@current_user@#\" ./*.reg")
|
||||
os.chdir(f"{b}/drive_c/users")
|
||||
if os.path.exists(f"{b}/drive_c/users/@current_user@"):
|
||||
self.run_command(f"rm -rfv '{b}/drive_c/users/@current_user@'")
|
||||
self.run_command(f"mv -fv '{os.getlogin()}' @current_user@")
|
||||
# 如果缩放文件 scale.txt 存在,需要移除以便用户自行调节缩放设置
|
||||
if os.path.exists(f"{b}/scale.txt"):
|
||||
os.remove(f"{b}/scale.txt")
|
||||
# 删除因为脚本失误导致用户目录嵌套(如果存在)
|
||||
if os.path.exists(f"{b}{b}/drive_c/users/@current_user@/@current_user@"):
|
||||
shutil.rmtree(f"{b}{b}/drive_c/users/@current_user@/@current_user@")
|
||||
# 删除无用的软链
|
||||
self.run_command(f"rm -fv '{b}/drive_c/users/@current_user@/我的'*")
|
||||
self.run_command(f"rm -fv '{b}/drive_c/users/@current_user@/My '*")
|
||||
self.run_command(f"rm -fv '{b}/drive_c/users/@current_user@/Desktop'")
|
||||
self.run_command(f"rm -fv '{b}/drive_c/users/@current_user@/Downloads'")
|
||||
self.run_command(f"rm -fv '{b}/drive_c/users/@current_user@/Templates'")
|
||||
os.chdir(b)
|
||||
# 对用户目录进行处理
|
||||
self.run_command("sed -i \"s#$USER#@current_user@#\" ./*.reg")
|
||||
os.chdir(f"{b}/drive_c/users")
|
||||
if os.path.exists(f"{b}/drive_c/users/@current_user@"):
|
||||
self.run_command(f"rm -rfv '{b}/drive_c/users/@current_user@'")
|
||||
self.run_command(f"mv -fv '{os.getlogin()}' @current_user@")
|
||||
# 如果缩放文件 scale.txt 存在,需要移除以便用户自行调节缩放设置
|
||||
if os.path.exists(f"{b}/scale.txt"):
|
||||
os.remove(f"{b}/scale.txt")
|
||||
# 删除因为脚本失误导致用户目录嵌套(如果存在)
|
||||
if os.path.exists(f"{b}{b}/drive_c/users/@current_user@/@current_user@"):
|
||||
shutil.rmtree(f"{b}{b}/drive_c/users/@current_user@/@current_user@")
|
||||
# 删除无用的软链
|
||||
self.run_command(f"rm -fv '{b}/drive_c/users/@current_user@/我的'*")
|
||||
self.run_command(f"rm -fv '{b}/drive_c/users/@current_user@/My '*")
|
||||
self.run_command(f"rm -fv '{b}/drive_c/users/@current_user@/Desktop'")
|
||||
self.run_command(f"rm -fv '{b}/drive_c/users/@current_user@/Downloads'")
|
||||
self.run_command(f"rm -fv '{b}/drive_c/users/@current_user@/Templates'")
|
||||
elif debArch.currentIndex() == 2 and e6_text.text()[-3: ] != ".7z":
|
||||
os.chdir(b)
|
||||
# 对用户目录进行处理
|
||||
self.run_command("sed -i \"s#$USER#crossover#\" ./*.reg")
|
||||
os.chdir(f"{b}/drive_c/users")
|
||||
if os.path.exists(f"{b}/drive_c/users/crossover"):
|
||||
self.run_command(f"rm -rfv '{b}/drive_c/users/crossover'")
|
||||
self.run_command(f"mv -fv '{os.getlogin()}' crossover")
|
||||
# 删除因为脚本失误导致用户目录嵌套(如果存在)
|
||||
if os.path.exists(f"{b}{b}/drive_c/users/crossover/crossover"):
|
||||
shutil.rmtree(f"{b}{b}/drive_c/users/crossover/crossover")
|
||||
# 删除无用的软链
|
||||
self.run_command(f"rm -fv '{b}/drive_c/users/crossover/我的'*")
|
||||
self.run_command(f"rm -fv '{b}/drive_c/users/crossover/My '*")
|
||||
self.run_command(f"rm -fv '{b}/drive_c/users/crossover/Desktop'")
|
||||
self.run_command(f"rm -fv '{b}/drive_c/users/crossover/Downloads'")
|
||||
self.run_command(f"rm -fv '{b}/drive_c/users/crossover/Templates'")
|
||||
os.chdir(programPath)
|
||||
###############
|
||||
# 压缩容器
|
||||
@ -186,6 +203,10 @@ def Build7z(b, self, debInformation, debPackagePath):
|
||||
if e6_text.text()[-3: ] == ".7z":
|
||||
shutil.copy(e6_text.text(), f"{debPackagePath}/opt/apps/{e1_text.text()}/files/files.7z")
|
||||
else:
|
||||
if debArch.currentIndex() == 2:
|
||||
# Crossover 包直接拷贝容器即可,无需打包 7z
|
||||
os.system(f"cp -rv '{b}' '{debPackagePath}/opt/cxoffice/support/{e5_text.text()}'")
|
||||
return
|
||||
if debPackagePath[-3: ] == ".7z":
|
||||
self.run_command("7z a '{}' '{}/'*".format(debPackagePath, b))
|
||||
else:
|
||||
@ -1047,8 +1068,178 @@ fi
|
||||
"installed_apps": false
|
||||
}}
|
||||
}}'''
|
||||
},
|
||||
{
|
||||
"Wine": None,
|
||||
"Architecture": "all",
|
||||
"Depends": "cxoffice20 | cxoffice5 | cxoffice5:i386",
|
||||
"run.sh": None,
|
||||
"info": None,
|
||||
"postinst": f'''#!/bin/sh
|
||||
# (c) Copyright 2008. CodeWeavers, Inc.
|
||||
|
||||
# Setup logging
|
||||
if [ -n "$CX_LOG" ]
|
||||
then
|
||||
[ "$CX_LOG" = "-" ] || exec 2>>"$CX_LOG"
|
||||
echo >&2
|
||||
echo "***** `date`" >&2
|
||||
echo "Starting: $0 $@" >&2
|
||||
set -x
|
||||
fi
|
||||
|
||||
action="$1"
|
||||
oldver="$2"
|
||||
|
||||
CX_ROOT="/opt/cxoffice"
|
||||
CX_BOTTLE="{e5_text.text()}"
|
||||
export CX_ROOT CX_BOTTLE
|
||||
|
||||
if [ "$action" = "configure" ]
|
||||
then
|
||||
uuid=""
|
||||
uuid_file="$CX_ROOT/support/$CX_BOTTLE/.uuid"
|
||||
if [ -f "$uuid_file" ]
|
||||
then
|
||||
uuid=`cat "$uuid_file"`
|
||||
rm -f "$uuid_file"
|
||||
fi
|
||||
|
||||
set_uuid=""
|
||||
if [ -n "$uuid" ]
|
||||
then
|
||||
set_uuid="--set-uuid $uuid"
|
||||
fi
|
||||
|
||||
"$CX_ROOT/bin/cxbottle" $set_uuid --restored --removeall --install
|
||||
fi
|
||||
|
||||
# Make sure the script returns 0
|
||||
true
|
||||
|
||||
|
||||
''',
|
||||
"postrm": f'''#!/bin/sh
|
||||
# (c) Copyright 2008. CodeWeavers, Inc.
|
||||
|
||||
# Setup logging
|
||||
if [ -n "$CX_LOG" ]
|
||||
then
|
||||
[ "$CX_LOG" = "-" ] || exec 2>>"$CX_LOG"
|
||||
echo >&2
|
||||
echo "***** `date`" >&2
|
||||
echo "Starting: $0 $@" >&2
|
||||
set -x
|
||||
fi
|
||||
|
||||
action="$1"
|
||||
|
||||
CX_ROOT="/opt/cxoffice"
|
||||
CX_BOTTLE="{e5_text.text()}"
|
||||
export CX_ROOT CX_BOTTLE
|
||||
|
||||
if [ "$action" = "purge" ]
|
||||
then
|
||||
# Delete any leftover file
|
||||
rm -rf "$CX_ROOT/support/$CX_BOTTLE"
|
||||
fi
|
||||
|
||||
# Make sure the script returns 0
|
||||
true
|
||||
|
||||
|
||||
''',
|
||||
"preinst": f'''#!/bin/sh
|
||||
# (c) Copyright 2008. CodeWeavers, Inc.
|
||||
|
||||
# Setup logging
|
||||
if [ -n "$CX_LOG" ]
|
||||
then
|
||||
[ "$CX_LOG" = "-" ] || exec 2>>"$CX_LOG"
|
||||
echo >&2
|
||||
echo "***** `date`" >&2
|
||||
echo "Starting: $0 $@" >&2
|
||||
set -x
|
||||
fi
|
||||
|
||||
action="$1"
|
||||
oldver="$2"
|
||||
|
||||
CX_ROOT="/opt/cxoffice"
|
||||
CX_BOTTLE="{e5_text.text()}"
|
||||
export CX_ROOT CX_BOTTLE
|
||||
|
||||
case "$action" in
|
||||
install|upgrade)
|
||||
if [ ! -f "$CX_ROOT/bin/cxbottle" ]
|
||||
then
|
||||
echo "error: could not find CrossOver in '$CX_ROOT'" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -x "$CX_ROOT/bin/cxbottle" ]
|
||||
then
|
||||
echo "error: the '$CX_ROOT/bin/cxbottle' tool is not executable!" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -x "$CX_ROOT/bin/wineprefixcreate" -o ! -f "$CX_ROOT/bin/wineprefixcreate" ]
|
||||
then
|
||||
echo "error: managed bottles are not supported in this version of CrossOver" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -d "$CX_ROOT/support/$CX_BOTTLE" ]
|
||||
then
|
||||
# Save the bottle's uuid
|
||||
"$CX_ROOT/bin/cxbottle" --get-uuid >"$CX_ROOT/support/$CX_BOTTLE/.uuid" 2>/dev/null
|
||||
fi
|
||||
;;
|
||||
|
||||
abort-upgrade)
|
||||
rm -f "$CX_ROOT/support/$CX_BOTTLE/.uuid"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Make sure the script returns 0
|
||||
true
|
||||
|
||||
|
||||
''',
|
||||
"prerm": f'''#!/bin/sh
|
||||
# (c) Copyright 2008. CodeWeavers, Inc.
|
||||
|
||||
# Setup logging
|
||||
if [ -n "$CX_LOG" ]
|
||||
then
|
||||
[ "$CX_LOG" = "-" ] || exec 2>>"$CX_LOG"
|
||||
echo >&2
|
||||
echo "***** `date`" >&2
|
||||
echo "Starting: $0 $@" >&2
|
||||
set -x
|
||||
fi
|
||||
|
||||
action="$1"
|
||||
if [ "$2" = "in-favour" ]
|
||||
then
|
||||
# Treating this as an upgrade is less work and safer
|
||||
action="upgrade"
|
||||
fi
|
||||
|
||||
CX_ROOT="/opt/cxoffice"
|
||||
CX_BOTTLE="{e5_text.text()}"
|
||||
export CX_ROOT CX_BOTTLE
|
||||
|
||||
if [ "$action" = "remove" ]
|
||||
then
|
||||
# Uninstall the bottle before cxbottle.conf gets deleted
|
||||
"$CX_ROOT/bin/cxbottle" --removeall
|
||||
fi
|
||||
|
||||
# Make sure the script returns 0
|
||||
true
|
||||
|
||||
|
||||
'''
|
||||
}
|
||||
|
||||
]
|
||||
print("c")
|
||||
if os.path.exists(wine[wineVersion.currentText()]):
|
||||
@ -1161,9 +1352,16 @@ fi
|
||||
###############
|
||||
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()))
|
||||
|
||||
if debArch.currentIndex() != 2:
|
||||
# Deepin Wine 包目录结构
|
||||
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()))
|
||||
else:
|
||||
# Crossover包目录结构
|
||||
os.makedirs(f"{debPackagePath}/opt/cxoffice/support/{e5_text.text()}")
|
||||
# 为啥就没了
|
||||
###############
|
||||
# 创建文件
|
||||
###############
|
||||
@ -1171,12 +1369,14 @@ fi
|
||||
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()))
|
||||
if debArch.currentIndex() != 2:
|
||||
os.mknod("{}/opt/apps/{}/info".format(debPackagePath, e1_text.text()))
|
||||
#########!!!!!!!
|
||||
Build7z(b, self, debInformation, debPackagePath)
|
||||
###############
|
||||
# 压缩 Wine
|
||||
###############
|
||||
# Deepin Wine 包
|
||||
print("e")
|
||||
self.label.emit("正在处理 Wine")
|
||||
if os.path.exists(wine[wineVersion.currentText()]):
|
||||
@ -1190,7 +1390,7 @@ fi
|
||||
# 复制文件
|
||||
###############
|
||||
self.label.emit("正在复制文件……")
|
||||
if os.path.exists(wine[wineVersion.currentText()]):
|
||||
if os.path.exists(wine[wineVersion.currentText()]) and debArch.currentIndex() != 2:
|
||||
shutil.copy(f"{programPath}/gtkGetFileNameDlg", f"{debPackagePath}/opt/apps/{e1_text.text()}/files")
|
||||
# arm64 box86 需要复制 dlls-arm 目录
|
||||
'''if debArch.currentIndex() == 1:
|
||||
@ -1228,12 +1428,13 @@ fi
|
||||
self.run_command(f"cp -rv '{programPath}/arm-package/'* {debPackagePath}/opt/apps/{e1_text.text()}/files/")
|
||||
#self.run_command(f"cp -rv '{programPath}/wined3d.dll.so' {debPackagePath}/opt/apps/{e1_text.text()}/files/")
|
||||
pass
|
||||
if desktopIconTab.count() <= 1:
|
||||
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))
|
||||
else:
|
||||
for i in range(len(a)):
|
||||
shutil.copy(iconUiList[i][4].text(), "{}/{}".format(debPackagePath, a[i]))
|
||||
if debArch.currentIndex() != 2:
|
||||
if desktopIconTab.count() <= 1:
|
||||
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))
|
||||
else:
|
||||
for i in range(len(a)):
|
||||
shutil.copy(iconUiList[i][4].text(), "{}/{}".format(debPackagePath, a[i]))
|
||||
################
|
||||
# 获取文件大小
|
||||
################
|
||||
@ -1272,6 +1473,14 @@ Description: {e3_text.text()}
|
||||
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"])
|
||||
try:
|
||||
# 因为不一定含有此项,所以需要 try except
|
||||
if debInformation[debArch.currentIndex()]["preinst"] != "":
|
||||
write_txt(f"{debPackagePath}/DEBIAN/preinst", debInformation[debArch.currentIndex()]["preinst"])
|
||||
if debInformation[debArch.currentIndex()]["prerm"] != "":
|
||||
write_txt(f"{debPackagePath}/DEBIAN/prerm", debInformation[debArch.currentIndex()]["prerm"])
|
||||
except:
|
||||
pass
|
||||
replaceMap = [
|
||||
["@@@BOTTLENAME@@@", e5_text.text()],
|
||||
["@@@APPVER@@@", e2_text.text()],
|
||||
@ -1281,8 +1490,11 @@ Description: {e3_text.text()}
|
||||
["@@@EXEC_NAME@@@", os.path.basename(e7_text.text().replace("\\", "/"))]
|
||||
]
|
||||
line = "\\"
|
||||
if desktopIconTab.count() <= 1:
|
||||
if desktopIconTab.count() <= 1 and debArch.currentIndex() != 2:
|
||||
write_txt("{}/opt/apps/{}/entries/applications/{}.desktop".format(debPackagePath, e1_text.text(), e1_text.text()), '#!/usr/bin/env xdg-open\n[Desktop Entry]\nEncoding=UTF-8\nType=Application\nX-Created-By={}\nCategories={};\nIcon={}\nExec="/opt/apps/{}/files/run.sh" --uri {}\nName={}\nComment={}\nMimeType={}\nGenericName={}\nTerminal=false\nStartupNotify=false\n'.format(e4_text.text(), option1_text.currentText(), a, e1_text.text(), e15_text.text(), e8_text.text(), e3_text.text(), e10_text.text(), e1_text.text()))
|
||||
elif debArch.currentIndex() == 2:
|
||||
# 直接跳过 .desktop 文件生成
|
||||
pass
|
||||
else:
|
||||
for i in range(len(iconUiList)):
|
||||
if iconUiList[i][2].text().replace(" ", "") == "":
|
||||
@ -1305,7 +1517,7 @@ Terminal=false
|
||||
StartupNotify=false
|
||||
''')
|
||||
# 要开始分类讨论了
|
||||
if debArch.currentIndex() == 0 or debArch.currentIndex() == 1:
|
||||
if debArch.currentIndex() == 0 or debArch.currentIndex() == 1 and debArch.currentIndex() != 2:
|
||||
if desktopIconTab.count() <= 1:
|
||||
write_txt(f"{debPackagePath}/opt/apps/{e1_text.text()}/files/run.sh", ReplaceText(debInformation[debArch.currentIndex()]["run.sh"], replaceMap))
|
||||
else:
|
||||
@ -1321,7 +1533,8 @@ StartupNotify=false
|
||||
line = "\\"
|
||||
write_txt(f"{debPackagePath}/opt/apps/{e1_text.text()}/files/{os.path.splitext(os.path.basename(i[0].text().replace(line, '/')))[0]}.sh", ReplaceText(debInformation[debArch.currentIndex()]["run.sh"], replaceMap))
|
||||
if debArch.currentIndex() == 1 and False:
|
||||
write_txt(f"{debPackagePath}/opt/apps/{e1_text.text()}/files/kill.sh", debInformation[debArch.currentIndex()]["kill.sh"])
|
||||
# 废弃内容
|
||||
'''write_txt(f"{debPackagePath}/opt/apps/{e1_text.text()}/files/kill.sh", debInformation[debArch.currentIndex()]["kill.sh"])
|
||||
if desktopIconTab.count() <= 1:
|
||||
write_txt(f"{debPackagePath}/opt/apps/{e1_text.text()}/files/run_with_box86.sh", ReplaceText(debInformation[debArch.currentIndex()]["run_with_box86.sh"], replaceMap))
|
||||
write_txt(f"{debPackagePath}/opt/apps/{e1_text.text()}/files/run_with_exagear.sh", ReplaceText(debInformation[debArch.currentIndex()]["run_with_exagear.sh"], replaceMap))
|
||||
@ -1335,22 +1548,25 @@ StartupNotify=false
|
||||
["@@@DEB_PACKAGE_NAME@@@", e1_text.text()],
|
||||
["@@@APPRUN_CMD@@@", wine[wineVersion.currentText()]],
|
||||
["@@@EXEC_NAME@@@", os.path.basename(i[0].text().replace("\\", "/"))]
|
||||
]
|
||||
]'''
|
||||
#write_txt(f"{debPackagePath}/opt/apps/{e1_text.text()}/files/{os.path.splitext(os.path.basename(i[0].text().replace(line, '/')))[0]}_with_box86.sh", ReplaceText(debInformation[debArch.currentIndex()]["run_with_box86.sh"], replaceMap))
|
||||
#write_txt(f"{debPackagePath}/opt/apps/{e1_text.text()}/files/{os.path.splitext(os.path.basename(i[0].text().replace(line, '/')))[0]}_with_exagear.sh", ReplaceText(debInformation[debArch.currentIndex()]["run_with_exagear.sh"], replaceMap))
|
||||
write_txt("{}/opt/apps/{}/info".format(debPackagePath, e1_text.text()), debInformation[debArch.currentIndex()]["info"])
|
||||
if debArch.currentIndex() != 2:
|
||||
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/*.sh".format(debPackagePath, e1_text.text()))
|
||||
#self.run_command("chmod -Rv 755 {}/opt/apps/{}/files/kill.sh".format(debPackagePath, e1_text.text()))
|
||||
#self.run_command("chmod -Rv 755 {}/opt/apps/{}/files/*_with_box86.sh".format(debPackagePath, e1_text.text()))
|
||||
#self.run_command("chmod -Rv 755 {}/opt/apps/{}/files/*_with_exagear.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()))
|
||||
if debArch.currentIndex() != 2:
|
||||
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 755 {}/opt/apps/{}/files/*.sh".format(debPackagePath, e1_text.text()))
|
||||
#self.run_command("chmod -Rv 755 {}/opt/apps/{}/files/kill.sh".format(debPackagePath, e1_text.text()))
|
||||
#self.run_command("chmod -Rv 755 {}/opt/apps/{}/files/*_with_box86.sh".format(debPackagePath, e1_text.text()))
|
||||
#self.run_command("chmod -Rv 755 {}/opt/apps/{}/files/*_with_exagear.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()))
|
||||
################
|
||||
# 构建 deb 包
|
||||
################
|
||||
@ -1650,7 +1866,8 @@ def ReadDeb(unzip = False):
|
||||
lnkMap[name].setText(value)
|
||||
continue
|
||||
# 其它的特殊情况判断
|
||||
if name == "START_SHELL_PATH" and value == "/opt/deepinwine/tools/spark_run_v4.sh":
|
||||
# 在选择 arm 架构的情况下不勾选
|
||||
if name == "START_SHELL_PATH" and value == "/opt/deepinwine/tools/spark_run_v4.sh" and debArch.currentIndex() == 0:
|
||||
# helper
|
||||
chooseWineHelperValue.setChecked(True)
|
||||
if name == "APPRUN_CMD" and value in wineValue:
|
||||
@ -1680,7 +1897,8 @@ def ReadDeb(unzip = False):
|
||||
lnkMap[name].setText(value)
|
||||
continue
|
||||
# 其它的特殊情况判断
|
||||
if name == "START_SHELL_PATH" and value == "/opt/deepinwine/tools/spark_run_v4.sh":
|
||||
# 在选择 arm 架构的情况下不勾选
|
||||
if name == "START_SHELL_PATH" and value == "/opt/deepinwine/tools/spark_run_v4.sh" and debArch.currentIndex() == 0:
|
||||
# helper
|
||||
chooseWineHelperValue.setChecked(True)
|
||||
if name == "APPRUN_CMD" and value in wineValue:
|
||||
@ -1710,7 +1928,8 @@ def ReadDeb(unzip = False):
|
||||
lnkMap[name].setText(value)
|
||||
continue
|
||||
# 其它的特殊情况判断
|
||||
if name == "START_SHELL_PATH" and value == "/opt/deepinwine/tools/spark_run_v4.sh":
|
||||
# 在选择 arm 架构的情况下不勾选
|
||||
if name == "START_SHELL_PATH" and value == "/opt/deepinwine/tools/spark_run_v4.sh" and debArch.currentIndex() == 0:
|
||||
# helper
|
||||
chooseWineHelperValue.setChecked(True)
|
||||
if name == "APPRUN_CMD" and value in wineValue:
|
||||
@ -1897,6 +2116,7 @@ cleanBottonByUOS = QtWidgets.QCheckBox(transla.transe("U", "使用统信 Wine
|
||||
disabledMono = QtWidgets.QCheckBox(transla.transe("U", "禁用 Mono 和 Gecko 安装器"))
|
||||
debArch = QtWidgets.QComboBox()
|
||||
debArch.addItems(["i386", "arm64(box86+exagear)"])
|
||||
#debArch.addItems(["i386", "arm64(box86+exagear)", "all(crossover)"])
|
||||
textbox1 = QtWidgets.QTextBrowser()
|
||||
option1_text.addItems(["Network", "Chat", "Audio", "Video", "Graphics", "Office", "Translation", "Development", "Utility"])
|
||||
option1_text.setCurrentText("Network")
|
||||
|
@ -2207,6 +2207,7 @@ try:
|
||||
for i in wine.keys():
|
||||
if not os.system(f"which '{wine[i]}'"):
|
||||
canUseWine.append(i)
|
||||
|
||||
if os.path.exists("/persistent/linglong/layers/"): # 判断是否使用 linglong
|
||||
for i in os.listdir("/persistent/linglong/layers/"):
|
||||
try:
|
||||
@ -2253,6 +2254,9 @@ try:
|
||||
if change:
|
||||
write_txt(get_home() + "/.config/deepin-wine-runner/WineSetting.json", json.dumps(setting))
|
||||
try:
|
||||
# Read /opt Wine
|
||||
for i in os.listdir("/opt"):
|
||||
pass
|
||||
# 不再从列表读取,直接读目录
|
||||
for i in os.listdir(f"{programPath}/wine/"):
|
||||
#for i in json.loads(readtxt(f"{programPath}/wine/winelist.json")):
|
||||
@ -2423,10 +2427,10 @@ Qt 版本:{QtCore.qVersion()}
|
||||
<p>是由 @gfdgd xi 带头的团队,gfdgd xi开发了UEngine运行器等好用的开源软件。</p>
|
||||
<hr>
|
||||
<h1>友谊链接</h1>
|
||||
<pre>星火应用商店:https://spark-app.store/
|
||||
Deepin 官网:https://www.deepin.org
|
||||
Deepin 论坛:https://bbs.deepin.org
|
||||
论坛:https://gfdgdxi.flarum.cloud/</pre>
|
||||
<pre>星火应用商店:<a href="https://spark-app.store/">https://spark-app.store/</a>
|
||||
Deepin 官网:<a href="https://www.deepin.org">https://www.deepin.org</a>
|
||||
Deepin 论坛:<a href="https://bbs.deepin.org">https://bbs.deepin.org</a>
|
||||
论坛:<a href="https://bbs.racoongx.cn">https://bbs.racoongx.cn</a></pre>
|
||||
<hr>
|
||||
<h1>©2020~{time.strftime("%Y")} By gfdgd xi、为什么您不喜欢熊出没和阿布呢,RacoonGX 团队作品</h1>'''
|
||||
title = "Wine 运行器 {}".format(version)
|
||||
@ -2938,6 +2942,12 @@ help.addAction(h2)
|
||||
help.addAction(h3)
|
||||
help.addAction(h4)
|
||||
help.addSeparator()
|
||||
|
||||
zanShang = menu.addMenu("赞赏我们")
|
||||
zanShangAction = QtWidgets.QAction("赞赏我们")
|
||||
zanShang.addAction(zanShangAction)
|
||||
zanShangAction.triggered.connect(lambda: webbrowser.open_new_tab("http://dt.racoongx.cn/"))
|
||||
|
||||
wikiHelp = QtWidgets.QAction(QtWidgets.QApplication.style().standardIcon(20), transla.transe("U", "程序 Wiki"))
|
||||
help.addAction(wikiHelp)
|
||||
videoHelp = help.addMenu(QtWidgets.QApplication.style().standardIcon(20), transla.transe("U", "视频教程"))
|
||||
|
Binary file not shown.
37
deb/opt/apps/deepin-wine-runner/pardus-chroot
Executable file
37
deb/opt/apps/deepin-wine-runner/pardus-chroot
Executable file
@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
set +e
|
||||
DESTDIR="$1"
|
||||
if [[ $UID -ne 0 ]] ; then
|
||||
echo "You must be root!"
|
||||
exit 1
|
||||
fi
|
||||
if [[ -b "$1" ]] ; then
|
||||
DESTDIR=$(mktemp -d)
|
||||
mount "$1" "$DESTDIR"
|
||||
fi
|
||||
shift
|
||||
if [[ "$DESTDIR" == "" || ! -f "$DESTDIR/etc/os-release" ]] ; then
|
||||
echo "Target filesystem is invalid: $DESTDIR"
|
||||
exit 1
|
||||
fi
|
||||
mount --bind /dev "$DESTDIR/dev"
|
||||
mount --bind /run "$DESTDIR/run"
|
||||
mount --bind /media "$DESTDIR/media"
|
||||
mount -t devpts devpts "$DESTDIR/dev/pts"
|
||||
mount -t sysfs sysfs "$DESTDIR/sys"
|
||||
mount -t proc proc "$DESTDIR/proc"
|
||||
mount -t tmpfs tmpfs "$DESTDIR/dev/shm"
|
||||
if [[ -d /sys/firmware/efi/ ]] ; then
|
||||
mount -t efivarfs efivarfs "$DESTDIR/sys/firmware/efi/efivars"
|
||||
fi
|
||||
#cat /etc/resolv.conf > $DESTDIR/etc/resolv.conf
|
||||
SHELL=/bin/bash unshare --fork --pid chroot "$DESTDIR" "$@"
|
||||
exit
|
||||
# 下面的因为有问题,不使用
|
||||
#if [[ -d /sys/firmware/efi/ ]] ; then
|
||||
# while umount "$DESTDIR/sys/firmware/efi/efivars" 2>/dev/null ; do : ;done
|
||||
#fi
|
||||
#for dir in dev/pts dev/shm dev sys proc run media ; do
|
||||
# while umount "$DESTDIR/$dir" 2>/dev/null; do : ;done
|
||||
#done
|
||||
#umount -lf "$DESTDIR" 2>/dev/null
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user