This commit is contained in:
gfdgd xi 2022-11-15 12:39:43 +08:00
parent 51364b5365
commit 8b9a54ed41
8 changed files with 248 additions and 296 deletions

View File

@ -70,6 +70,8 @@ m m "
["deepin-wine5-stable", "deepin-wine5-stable"],
["deepin-wine6-stable", "deepin-wine6-stable"]
]:
if not os.system(f"which {i[1]} > /dev/null"):
continue
choose = input(f"安装{i[0]}?(添加深度源)[Y/N]").upper()
if choose == "Y":
print("安装中……")
@ -80,6 +82,10 @@ m m "
["deepin-wine", "deepin-wine"],
["spark-wine7-devel", "spark-wine7-devel"]
]:
if not os.system(f"which {i[1]} > /dev/null"):
continue
choose = input(f"安装{i[0]}?(添加深度、星火源)[Y/N]").upper()
if choose == "Y":
InstallWithSparkStoreSource(i[1])
InstallWithSparkStoreSource(i[1])
input("按回车键后退出……")
exit()

101
InstallWineOnDeepin23Alpha.py Executable file
View File

@ -0,0 +1,101 @@
#!/usr/bin/env python3
# 使用系统默认的 python3 运行
###########################################################################################
# 作者gfdgd xi、为什么您不喜欢熊出没和阿布呢
# 版本2.4.2
# 更新时间2022年11月13日
# 感谢:感谢 wine 以及 deepin-wine 团队,提供了 wine 和 deepin-wine 给大家使用,让我能做这个程序
# 基于 Python3 构建
###########################################################################################
#################
# 引入所需的库
#################
import os
import webbrowser
def YesOrNo():
if input().replace(" ", "").upper() == "N":
return False
return True
def InstallWine(wine):
print(f"开始安装 {wine}")
if not os.system(f"pkexec apt install {wine} -y"):
print(f"{wine} 安装失败!")
PressEnter()
else:
print("安装完成")
def CheckSparkStore():
return os.system("which spark-store > /dev/null") + os.system("which aptss > /dev/null")
def InstallSparkStore():
if not CheckSparkStore:
return
print("按下回车键后打开星火应用商店官网,手动安装完星火应用商店后再次按下回车以继续")
webbrowser.open_new_tab("https://spark-app.store/")
PressEnter()
print("安装星火应用商店后按下回车……")
PressEnter()
while True:
if not os.system("which spark-store > /dev/null"):
if not os.system("which aptss > /dev/null"):
break
print("您暂未安装最新版本的星火应用商店,请更新版本后按下回车")
PressEnter()
continue
print("您暂未安装星火应用商店,请在安装后按下回车")
PressEnter()
continue
def InstallDeepinAppStore():
print("开始安装官方应用商店")
if not os.system("pkexec apt install deepin-app-store -y"):
print("安装失败!按回车键后退出")
PressEnter()
exit()
else:
print("安装完成")
def PressEnter():
input("按回车键后继续……")
if __name__ == "__main__":
print('''
m m "
# # # mmm m mm mmm
" #"# # # #" # #" #
## ##" # # # #""""
# # mm#mm # # "#mm"
''')
print("后续操作需要有 root 权限")
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
# 敢这样浪不还是 Alpha 源有官方应用商店
if not os.system("which deepin-home-appstore-client > /dev/null"):
print("暂未安装官方应用商店,安装后才能继续,是否安装?[Y/N]")
if YesOrNo:
InstallDeepinAppStore()
deepinWineList = [
"deepin-wine6-stable"
]
for i in deepinWineList:
if not os.system(f"which {i} > /dev/null"):
continue
print(f"是否安装 {i}[Y/N]")
if YesOrNo:
InstallWine(i)
sparkWineList = [
]
for i in sparkWineList:
if not os.system(f"which {i} > /dev/null"):
continue
print(f"是否安装 {i}[Y/N]")
if YesOrNo:
InstallSparkStore()
InstallWine(i)
print("按回车键退出")
PressEnter()
exit()

BIN
arm-package.7z Executable file → Normal file

Binary file not shown.

View File

@ -308,7 +308,7 @@ class make_deb_threading(QtCore.QThread):
im = Image.open(e9_text.text())
imms = im.format.lower()
except: # 未知(就直接设置为 svg 后缀)
imms = ".svg"
imms = "svg"
a = "/opt/apps/{}/entries/icons/hicolor/scalable/apps/{}.{}".format(e1_text.text(), e1_text.text(), imms)
if not os.path.exists(e9_text.text()):
self.errorMsg.emit("图标的路径填写错误,无法进行构建 deb 包")
@ -549,91 +549,25 @@ fi"""
# ARM64 通用 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": "zenity, com.deepin-wine6-stable.deepin(>=6.0deepin31), deepin-wine-exagear-images(>=10deepin4), com.deepin-box86.deepin(>=0.2.3deepin21), deepin-elf-verify (>= 1.1.1-1), p7zip-full, fonts-wqy-microhei, fonts-noto-cjk",
"postinst": f"""#!/bin/bash
"Depends": "com.deepin-wine6-stable.deepin (>= 6.0deepin31), com.wine-helper.deepin (>= 0.0.8), com.deepin-box86.deepin (>= 0.2.6deepin3), deepin-elf-verify (>= 1.1.1-1)",
"postinst": f"""#!/bin/sh
DEB_PATH=/opt/apps/{e1_text.text()}
if [ -f $DEB_PATH/files/wined3d.dll.so ] && [ -d "/usr/lib/nvidia" ];then
mv $DEB_PATH/files/wined3d.dll.so $DEB_PATH/files/dlls
ACTIVEX_NAME=""
if [ -f "/opt/apps/{e1_text.text()}/files/install.sh" ];then
/opt/apps/{e1_text.text()}/files/install.sh -i
fi
KUNPENG="0x48"
cpu_vendor=$(lscpu | grep Vendor | awk '{{print $3}}')
KIRIN=`cat /proc/cpuinfo | grep Kirin`
if [ ! -z "$KIRIN" ];then
mv $DEB_PATH/files/*.so $DEB_PATH/files/dlls
fi
## check if the cpu support arm32 instruction or not, 126 means unsupported
/opt/deepin-box86/box86 -v
CHECK_ARM32=$?
IMAGE_VER=10deepin3
IMAGE_DIR=/opt/deepin-wine-exagear-images/debian-buster
ARCHIVE_FILE=files.7z
download_image() {{
pushd /var/cache/apt/archives >/dev/null
apt download deepin-wine-exagear-images
dpkg -x deepin-wine-exagear-images*.deb /
rm deepin-wine-exagear-images*.deb
echo $IMAGE_VER > $IMAGE_DIR/VERSION
popd >/dev/null
}}
move_box86_runsh() {{
if [[ -f $DEB_PATH/files/run_with_exagear.sh ]]; then
echo 单图标
mv $DEB_PATH/files/run_with_exagear.sh $DEB_PATH/files/run.sh
else
echo 多图标
for shell_path in $(ls $DEB_PATH/files/*_with_exagear.sh)
do
name=${{shell_path#$DEB_PATH/files/}}
name=${{name%_with_exagear.sh}}
mv $shell_path $DEB_PATH/files/$name.sh
done
if [ -n "$ACTIVEX_NAME" ]; then
if [ ! -d "/usr/lib/mozilla/plugins" ];then
mkdir -p /usr/lib/mozilla/plugins
fi
}}
move_exagear_runsh() {{
if [[ -f $DEB_PATH/files/run_with_exagear.sh ]]; then
echo 单图标
mv $DEB_PATH/files/run_with_box86.sh $DEB_PATH/files/run.sh
else
echo 多图标
for shell_path in $(ls $DEB_PATH/files/*_with_box86.sh)
do
name=${{shell_path#$DEB_PATH/files/}}
name=${{name%_with_box86.sh}}
mv $shell_path $DEB_PATH/files/$name.sh
done
fi
}}
if [[ "$KUNPENG" == "$cpu_vendor" ]] || [[ $CHECK_ARM32 != 0 ]];then
echo "use exagear as emulator..."
if [ ! -d /opt/exagear/bin ];then
mkdir /opt/exagear/bin -p
fi
if [ ! -e /opt/exagear/bin/ubt_x32a64_al ];then
cp $DEB_PATH/files/exa/ubt_x32a64_al /opt/exagear/bin/ubt_x32a64_al
fi
if [ ! -e /opt/exagear/bin/ubt_x64a64_al ];then
cp $DEB_PATH/files/exa/ubt_x64a64_al /opt/exagear/bin/ubt_x64a64_al
fi
move_exagear_runsh
mv $DEB_PATH/files/exa/wineserver /opt/deepin-wine6-stable/bin/wineserver
else
echo "use box86 as emulator..."
move_box86_runsh
mv $DEB_PATH/files/run_with_box86.sh $DEB_PATH/files/run.sh
cp /usr/lib/pipelight/libpipelight.so /usr/lib/mozilla/plugins/libpipelight-${{ACTIVEX_NAME}}.so
glib-compile-schemas /usr/share/glib-2.0/schemas/
fi
# Make sure the script returns 0
true
""",
# 因为 arm 不依赖 helper所以要自带 kill.sh
"kill.sh": """#!/bin/bash
@ -915,7 +849,37 @@ else
kill_app $APP_NAME
fi
""",
"postrm": f"""#!/bin/bash
"postrm": [f"""#!/bin/sh
ACTIVEX_NAME=""
if [ -f "/opt/apps/{e1_text.text()}/files/install.sh" ];then
/opt/apps/{e1_text.text()}/files/install.sh -r
fi
if [ -n "$ACTIVEX_NAME" ]; then
rm /usr/lib/mozilla/plugins/libpipelight-${{ACTIVEX_NAME}}.so
glib-compile-schemas /usr/share/glib-2.0/schemas/
fi
# Make sure the script returns 0
true
""", f"""#!/bin/sh
ACTIVEX_NAME=""
if [ -f "/opt/apps/{e1_text.text()}/files/install.sh" ];then
/opt/apps/{e1_text.text()}/files/install.sh -r
fi
if [ -n "$ACTIVEX_NAME" ]; then
rm /usr/lib/mozilla/plugins/libpipelight-${{ACTIVEX_NAME}}.so
glib-compile-schemas /usr/share/glib-2.0/schemas/
fi
# Make sure the script returns 0
true
# Clean Botton
if [ "$1" = "remove" ] || [ "$1" = "purge" ];then
echo "清理卸载残留"
@ -940,224 +904,95 @@ for username in $(ls /home)
else
echo "非卸载,跳过清理"
fi
""",
"run_with_box86.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/deepin-box86/box86"
EMU_ARGS=
EXE="@@@EXEC_PATH@@@"
NEW_VERSION="{e2_text.text()}"
BOTTLE="$HOME/.deepinwine/{e5_text.text()}"
"""][int(rmBash.isChecked())],
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
}}
# 又又又改
"run.sh": f"""#!/bin/bash
# Copyright (C) 2016 Deepin, Inc.
#
# Author: Li LongYu <lilongyu@linuxdeepin.com>
# Peng Hao <penghao@linuxdeepin.com>
version_gt() {{ test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; }}
ACTIVEX_NAME=""
BOTTLENAME="@@@BOTTLENAME@@@"
APPVER="@@@APPVER@@@"
EXEC_PATH="@@@EXEC_PATH@@@"
START_SHELL_PATH="/opt/deepinwine/tools/run_v4.sh"
export MIME_TYPE=""
export MIME_EXEC=""
export DEB_PACKAGE_NAME="{e1_text.text()}"
export APPRUN_CMD="deepin-wine6-stable"
DISABLE_ATTACH_FILE_DIALOG=""
EXPORT_ENVS=""
EXEC_NAME="@@@EXEC_NAME@@@"
INSTALL_SETUP=""
export BOX86_EMU_CMD="/opt/deepin-box86/stable/box86"
export SPECIFY_SHELL_DIR=`dirname $START_SHELL_PATH`
ARCHIVE_FILE_DIR="/opt/apps/$DEB_PACKAGE_NAME/files"
if [ -z "$APPRUN_CMD" ];then
export APPRUN_CMD="/opt/deepin-wine6-stable/bin/wine"
fi
if [ -f "$APPRUN_CMD" ];then
wine_path=$(dirname $APPRUN_CMD)
wine_path=$(realpath "$wine_path/../")
export WINEDLLPATH=$wine_path/lib:$wine_path/lib64
else
progressbar()
{{
cat -
}}
export WINEDLLPATH=/opt/$APPRUN_CMD/lib:/opt/$APPRUN_CMD/lib64
fi
reconstruct_bottle_symlink() {{
export WINEPREDLL="$ARCHIVE_FILE_DIR/dlls"
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
_SetRegistryValue()
{{
env WINEPREFIX="$BOTTLEPATH" $APPRUN_CMD reg ADD "$1" /v "$2" /t "$3" /d "$4" /f
}}
if [ ! -d "$HOME/.deepinwine" ];then
mkdir -p "$HOME/.deepinwine"
if [ -z "$DISABLE_ATTACH_FILE_DIALOG" ];then
export ATTACH_FILE_DIALOG=1
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
if [ -n "$EXPORT_ENVS" ];then
export $EXPORT_ENVS
fi
# 打包安装程序的情况
if [[ -z "$EXEC_PATH" ]] && [[ -n "$INSTALL_SETUP" ]];then
$START_SHELL_PATH $BOTTLENAME $APPVER "$EXEC_PATH" -c
BOTTLEPATH="$HOME/.deepinwine/$BOTTLENAME"
EXEC_PATH=$(find "$BOTTLEPATH" -name $EXEC_NAME | head -1)
if [ -z "$EXEC_PATH" ];then
_SetRegistryValue "HKCU\\Software\\Wine\\DllOverrides" winemenubuilder.exe REG_SZ
WINEPREFIX="$BOTTLEPATH" $APPRUN_CMD "$ARCHIVE_FILE_DIR/$INSTALL_SETUP"
EXEC_PATH=$(find "$BOTTLEPATH" -name $EXEC_NAME | head -1)
cp "$ARCHIVE_FILE_DIR/setup.md5sum" "$BOTTLEPATH"
fi
if [ -z "$EXEC_PATH" ];then
echo "安装失败退出"
exit
fi
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
ulimit -s 8192
WINEPREFIX=$BOTTLE $EMU $EMU_ARGS $WINE "$EXE" & #--disable-gpu &
""",
"run_with_exagear.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="@@@EXEC_PATH@@@"
NEW_VERSION="{e2_text.text()}"
BOTTLE="$HOME/.deepinwine/{e5_text.text()}"
IMG_ARCHIVE_DIR=/opt/deepin-wine-exagear-images/debian-buster
IMAGE_VER="10deepin4"
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
}}
if [ -n "$EXEC_PATH" ];then
if [ -z "${{EXEC_PATH##*.lnk*}}" ];then
$START_SHELL_PATH $BOTTLENAME $APPVER "C:/windows/command/start.exe" "/Unix" "$EXEC_PATH" "$@"
elif [ -z "${{EXEC_PATH##*.bat}}" ];then
$START_SHELL_PATH $BOTTLENAME $APPVER "cmd" -f /c "$EXEC_PATH" "${{@:2}}"
else
$START_SHELL_PATH $BOTTLENAME $APPVER "$EXEC_PATH" "$@"
fi
elif [ -n "$ACTIVEX_NAME" ] && [ $# -gt 1 ];then
$START_SHELL_PATH $BOTTLENAME $APPVER "$1" -f "${{@:2}}"
else
progressbar()
{{
cat -
}}
$START_SHELL_PATH $BOTTLENAME $APPVER "uninstaller.exe" "$@"
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
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 [ ! -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
## 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 "$EXE" & #--disable-gpu &
""",
"info": f'''{{
"appid": "{e1_text.text()}",
@ -1342,9 +1177,10 @@ fi
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}/exa"):
self.run_command(f"7z x \"{programPath}/exa.7z\" -o\"{programPath}\"")
os.remove(f"{programPath}/exa.7z")
# 已废弃
#if not os.path.exists(f"{programPath}/exa"):
# self.run_command(f"7z x \"{programPath}/exa.7z\" -o\"{programPath}\"")
# os.remove(f"{programPath}/exa.7z")
if not os.path.exists(f"{programPath}/arm-package"):
self.run_command(f"7z x \"{programPath}/arm-package.7z\" -o\"{programPath}\"")
os.remove(f"{programPath}/arm-package.7z")
@ -1405,7 +1241,8 @@ Description: {e3_text.text()}
["@@@APPVER@@@", e2_text.text()],
["@@@EXEC_PATH@@@", e7_text.text()],
["@@@DEB_PACKAGE_NAME@@@", e1_text.text()],
["@@@APPRUN_CMD@@@", wine[wineVersion.currentText()]]
["@@@APPRUN_CMD@@@", wine[wineVersion.currentText()]],
["@@@EXEC_NAME@@@", os.path.basename(e7_text.text().replace("\\", "/"))]
]
if desktopIconTab.count() <= 1:
write_txt("{}/opt/apps/{}/entries/applications/{}.desktop".format(debPackagePath, e1_text.text(), e1_text.text()), '#!/usr/bin/env xdg-open\n[Desktop Entry]\nEncoding=UTF-8\nType=Application\nX-Created-By={}\nCategories={};\nIcon={}\nExec="/opt/apps/{}/files/run.sh" --uri {}\nName={}\nComment={}\nMimeType={}\nGenericName={}\nTerminal=false\nStartupNotify=false\n'.format(e4_text.text(), option1_text.currentText(), a, e1_text.text(), e15_text.text(), e8_text.text(), e3_text.text(), e10_text.text(), e1_text.text()))
@ -1427,7 +1264,7 @@ Terminal=false
StartupNotify=false
''')
# 要开始分类讨论了
if debArch.currentIndex() == 0:
if debArch.currentIndex() == 0 or debArch.currentIndex() == 1:
if desktopIconTab.count() <= 1:
write_txt(f"{debPackagePath}/opt/apps/{e1_text.text()}/files/run.sh", ReplaceText(debInformation[debArch.currentIndex()]["run.sh"], replaceMap))
else:
@ -1437,11 +1274,12 @@ StartupNotify=false
["@@@APPVER@@@", e2_text.text()],
["@@@EXEC_PATH@@@", i[0].text()],
["@@@DEB_PACKAGE_NAME@@@", e1_text.text()],
["@@@APPRUN_CMD@@@", wine[wineVersion.currentText()]]
["@@@APPRUN_CMD@@@", wine[wineVersion.currentText()]],
["@@@EXEC_NAME@@@", os.path.basename(i[0].text().replace("\\", "/"))]
]
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:
if debArch.currentIndex() == 1 and False:
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))
@ -1454,10 +1292,11 @@ StartupNotify=false
["@@@APPVER@@@", e2_text.text()],
["@@@EXEC_PATH@@@", i[0].text()],
["@@@DEB_PACKAGE_NAME@@@", e1_text.text()],
["@@@APPRUN_CMD@@@", wine[wineVersion.currentText()]]
["@@@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(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"])
################
# 修改文件权限
@ -1554,7 +1393,7 @@ def ChangeArchCombobox():
if debArch.currentIndex() == 0:
ChangeWine()
else:
debDepends.setText("zenity, com.deepin-wine6-stable.deepin(>=6.0deepin31), deepin-wine-exagear-images(>=10deepin4), com.deepin-box86.deepin(>=0.2.3deepin21), deepin-elf-verify (>= 1.1.1-1), p7zip-full, fonts-wqy-microhei, fonts-noto-cjk")
debDepends.setText("com.deepin-wine6-stable.deepin (>= 6.0deepin31), com.wine-helper.deepin (>= 0.0.8), com.deepin-box86.deepin (>= 0.2.6deepin3), deepin-elf-verify (>= 1.1.1-1)")
def InstallDeb():
os.system(f"xdg-open '{e12_text.text()}'")

BIN
dlls-arm.7z Executable file → Normal file

Binary file not shown.

BIN
exa.7z

Binary file not shown.

View File

@ -466,6 +466,9 @@ def InstallWine():
def InstallWineOnDeepin23():
threading.Thread(target=OpenTerminal, args=[f"'{programPath}/InstallWineOnDeepin23.py'"]).start()
def InstallWineOnDeepin23Alpha():
threading.Thread(target=OpenTerminal, args=[f"'{programPath}/InstallWineOnDeepin23Alpha.py'"]).start()
def InstallWineHQ():
threading.Thread(target=OpenTerminal, args=[f"{programPath}/InstallNewWineHQ.sh"]).start()
@ -2129,7 +2132,8 @@ mainLayout.addWidget(programRun, 2, 1, 1, 1)
menu = window.menuBar()
programmenu = menu.addMenu(QtCore.QCoreApplication.translate("U", "程序(&P)"))
p1 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "安装 wine(&I)"))
installWineOnDeepin23 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "安装 wine(只限Deepin23)"))
installWineOnDeepin23 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "安装 wine(只限Deepin23 Preview)"))
installWineOnDeepin23Alpha = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "安装 wine(只限Deepin23 Alpha)"))
installWineHQ = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "安装 WineHQ"))
installMoreWine = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "安装更多 Wine"))
p2 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "设置程序(&S)"))
@ -2139,6 +2143,7 @@ cleanProgramUnuse = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "
p4 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "退出程序(&E)"))
programmenu.addAction(p1)
programmenu.addAction(installWineOnDeepin23)
programmenu.addAction(installWineOnDeepin23Alpha)
programmenu.addAction(installWineHQ)
programmenu.addAction(installMoreWine)
programmenu.addSeparator()
@ -2151,6 +2156,7 @@ programmenu.addSeparator()
programmenu.addAction(p4)
p1.triggered.connect(InstallWine)
installWineOnDeepin23.triggered.connect(InstallWineOnDeepin23)
installWineOnDeepin23Alpha.triggered.connect(InstallWineOnDeepin23Alpha)
installWineHQ.triggered.connect(InstallWineHQ)
installMoreWine.triggered.connect(lambda: threading.Thread(target=os.system, args=[f"'{programPath}/wine/installwine'"]).start())
p2.triggered.connect(ProgramSetting.ShowWindow)