mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-12-14 02:52:03 +08:00
net检测demo
This commit is contained in:
@@ -20,7 +20,14 @@ import PyQt5.QtWidgets as QtWidgets
|
||||
from UI.AutoConfig import *
|
||||
from Model import *
|
||||
|
||||
urlSources = "https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/auto"
|
||||
urlSourcesList = [
|
||||
"https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/auto", # Gitlink 源
|
||||
"https://gitee.com/gfdgd-xi/deep-wine-runner-auto-configuration-script/raw/master/", # Gitee 源
|
||||
"https://gfdgd-xi.github.io/deep-wine-runner-auto-configuration-script/", # Github 源
|
||||
"http://gfdgdxi.msns.cn/wine-runner-list/auto/", # 备用源,纯 IPv6 源
|
||||
"http://127.0.0.1/wine-runner-list/auto/" # 本地测试源
|
||||
]
|
||||
urlSources = urlSourcesList[0]
|
||||
lists = []
|
||||
class ProgramRunStatusUpload():
|
||||
msgWindow = None
|
||||
@@ -319,6 +326,26 @@ def readtxt(path):
|
||||
f.close() # 关闭文本对象
|
||||
return str # 返回结果
|
||||
|
||||
def ChangeSources():
|
||||
global urlSources
|
||||
sources = [ui.actionGitlink, ui.actionGitee, ui.actionGithub, ui.action_IPv6, ui.action]
|
||||
for i in range(0, len(sources)):
|
||||
if sources[i].isChecked():
|
||||
urlSources = urlSourcesList[i]
|
||||
# 解析云列表
|
||||
try:
|
||||
# 获取列表
|
||||
lists = json.loads(requests.get(f"{urlSources}/list.json").text)
|
||||
# 解释列表并显示在 GUI 上
|
||||
nmodel = QtGui.QStandardItemModel(window)
|
||||
for i in lists:
|
||||
nmodel.appendRow(QtGui.QStandardItem(i[0]))
|
||||
ui.searchList.setModel(nmodel)
|
||||
except:
|
||||
traceback.print_exc()
|
||||
QtWidgets.QMessageBox.critical(window, "提示", "无法连接服务器")
|
||||
break
|
||||
|
||||
if __name__ == "__main__":
|
||||
homePath = os.path.expanduser('~')
|
||||
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
|
||||
@@ -339,6 +366,18 @@ if __name__ == "__main__":
|
||||
window.setWindowIcon(QtGui.QIcon(f"{programPath}/deepin-wine-runner.svg"))
|
||||
iconPath = "{}/deepin-wine-runner.svg".format(programPath)
|
||||
window.show()
|
||||
#ui.actionGitlink.setExclusive(True)
|
||||
sourcesGroup = QtWidgets.QActionGroup(window)
|
||||
sourcesGroup.addAction(ui.actionGitlink)
|
||||
sourcesGroup.addAction(ui.actionGitee)
|
||||
sourcesGroup.addAction(ui.actionGithub)
|
||||
sourcesGroup.addAction(ui.action_IPv6)
|
||||
sourcesGroup.addAction(ui.action)
|
||||
sourcesGroup.triggered.connect(ChangeSources)
|
||||
sourcesGroup.setExclusive(True)
|
||||
#for i in [ui.actionGitlink, ui.actionGitee, ui.actionGithub, ui.action_IPv6, ui.action]:
|
||||
#i.triggered.connect(ChangeSources)
|
||||
#pass
|
||||
# 连接信号和槽
|
||||
ui.saerchBotton.clicked.connect(Connect.SearchBotton_Clicked)
|
||||
ui.uploadFen.clicked.connect(UploadFen)
|
||||
|
||||
@@ -50,10 +50,12 @@ class Ui_MainWindow(object):
|
||||
self.verticalLayout_3.addLayout(self.horizontalLayout_2)
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
self.menubar = QtWidgets.QMenuBar(MainWindow)
|
||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 33))
|
||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 36))
|
||||
self.menubar.setObjectName("menubar")
|
||||
self.menu = QtWidgets.QMenu(self.menubar)
|
||||
self.menu.setObjectName("menu")
|
||||
self.menu_2 = QtWidgets.QMenu(self.menubar)
|
||||
self.menu_2.setObjectName("menu_2")
|
||||
MainWindow.setMenuBar(self.menubar)
|
||||
self.about = QtWidgets.QAction(MainWindow)
|
||||
self.about.setObjectName("about")
|
||||
@@ -63,10 +65,32 @@ class Ui_MainWindow(object):
|
||||
self.help.setObjectName("help")
|
||||
self.openFile = QtWidgets.QAction(MainWindow)
|
||||
self.openFile.setObjectName("openFile")
|
||||
self.actionGitlink = QtWidgets.QAction(MainWindow)
|
||||
self.actionGitlink.setCheckable(True)
|
||||
self.actionGitlink.setChecked(True)
|
||||
self.actionGitlink.setObjectName("actionGitlink")
|
||||
self.actionGitee = QtWidgets.QAction(MainWindow)
|
||||
self.actionGitee.setCheckable(True)
|
||||
self.actionGitee.setObjectName("actionGitee")
|
||||
self.actionGithub = QtWidgets.QAction(MainWindow)
|
||||
self.actionGithub.setCheckable(True)
|
||||
self.actionGithub.setObjectName("actionGithub")
|
||||
self.action_IPv6 = QtWidgets.QAction(MainWindow)
|
||||
self.action_IPv6.setCheckable(True)
|
||||
self.action_IPv6.setObjectName("action_IPv6")
|
||||
self.action = QtWidgets.QAction(MainWindow)
|
||||
self.action.setCheckable(True)
|
||||
self.action.setObjectName("action")
|
||||
self.menu.addAction(self.openFile)
|
||||
self.menu.addSeparator()
|
||||
self.menu.addAction(self.exitProgram)
|
||||
self.menu_2.addAction(self.actionGitlink)
|
||||
self.menu_2.addAction(self.actionGitee)
|
||||
self.menu_2.addAction(self.actionGithub)
|
||||
self.menu_2.addAction(self.action_IPv6)
|
||||
self.menu_2.addAction(self.action)
|
||||
self.menubar.addAction(self.menu.menuAction())
|
||||
self.menubar.addAction(self.menu_2.menuAction())
|
||||
|
||||
self.retranslateUi(MainWindow)
|
||||
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
||||
@@ -81,8 +105,14 @@ class Ui_MainWindow(object):
|
||||
self.uploadFen.setText(_translate("MainWindow", "提交选中项的评分"))
|
||||
self.runBotton.setText(_translate("MainWindow", "部署此方案"))
|
||||
self.menu.setTitle(_translate("MainWindow", "程序"))
|
||||
self.menu_2.setTitle(_translate("MainWindow", "切换源"))
|
||||
self.about.setText(_translate("MainWindow", "关于"))
|
||||
self.exitProgram.setText(_translate("MainWindow", "退出程序"))
|
||||
self.help.setText(_translate("MainWindow", "帮助"))
|
||||
self.openFile.setText(_translate("MainWindow", "打开本地部署脚本"))
|
||||
self.actionGitlink.setText(_translate("MainWindow", "Gitlink 源"))
|
||||
self.actionGitee.setText(_translate("MainWindow", "Gitee 源"))
|
||||
self.actionGithub.setText(_translate("MainWindow", "Github 源"))
|
||||
self.action_IPv6.setText(_translate("MainWindow", "备用源(只限IPv6用户)"))
|
||||
self.action.setText(_translate("MainWindow", "本地测试源"))
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>33</height>
|
||||
<height>36</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menu">
|
||||
@@ -103,7 +103,18 @@
|
||||
<addaction name="separator"/>
|
||||
<addaction name="exitProgram"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menu_2">
|
||||
<property name="title">
|
||||
<string>切换源</string>
|
||||
</property>
|
||||
<addaction name="actionGitlink"/>
|
||||
<addaction name="actionGitee"/>
|
||||
<addaction name="actionGithub"/>
|
||||
<addaction name="action_IPv6"/>
|
||||
<addaction name="action"/>
|
||||
</widget>
|
||||
<addaction name="menu"/>
|
||||
<addaction name="menu_2"/>
|
||||
</widget>
|
||||
<action name="about">
|
||||
<property name="text">
|
||||
@@ -125,6 +136,49 @@
|
||||
<string>打开本地部署脚本</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionGitlink">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Gitlink 源</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionGitee">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Gitee 源</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionGithub">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Github 源</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_IPv6">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>备用源(只限IPv6用户)</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>本地测试源</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
||||
Binary file not shown.
@@ -219,20 +219,29 @@ class make_deb_threading(QtCore.QThread):
|
||||
][int(chooseWineHelperValue.isChecked())],
|
||||
"postinst": "",
|
||||
"postrm": ["", f"""#!/bin/bash
|
||||
|
||||
if [ "$1" = "remove" ] || [ "$1" = "purge" ];then
|
||||
|
||||
echo "清理卸载残留"
|
||||
for username in `ls /home`
|
||||
CONTAINER_NAME="{e5_text.text()}"
|
||||
|
||||
if [ -z $CONTAINER_NAME ];then
|
||||
echo "W: 没有指定容器,跳过清理容器。请手动前往 ~/.deepinwine/ 下删除"
|
||||
exit
|
||||
fi
|
||||
|
||||
/opt/deepinwine/tools/kill.sh $CONTAINER_NAME
|
||||
###这里注意,如果没写CONTAINER_NAME,会把QQ杀了
|
||||
|
||||
for username in $(ls /home)
|
||||
do
|
||||
echo /home/$username
|
||||
if [ -d "/home/$username/.deepinwine/{e5_text.text()}" ]
|
||||
then
|
||||
rm -rf "/home/$username/.deepinwine/{e5_text.text()}"
|
||||
fi
|
||||
echo /home/$username
|
||||
if [ -d /home/$username/.deepinwine/$CONTAINER_NAME ]
|
||||
then
|
||||
rm -rf /home/$username/.deepinwine/$CONTAINER_NAME
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "非卸载,跳过清理"
|
||||
echo "非卸载,跳过清理"
|
||||
fi"""][int(rmBash.isChecked())],
|
||||
"run.sh": [
|
||||
f"""#!/bin/sh
|
||||
@@ -464,22 +473,312 @@ fi
|
||||
true
|
||||
|
||||
""",
|
||||
"postrm": f"""#!/bin/bash
|
||||
# 因为 arm 不依赖 helper,所以要自带 kill.sh
|
||||
"kill.sh": """#!/bin/bash
|
||||
|
||||
APP_NAME="QQ"
|
||||
LOG_FILE=$0
|
||||
SHELL_DIR=$(dirname $0)
|
||||
SHELL_DIR=$(realpath "$SHELL_DIR")
|
||||
if [ $SPECIFY_SHELL_DIR ]; then
|
||||
SHELL_DIR=$SPECIFY_SHELL_DIR
|
||||
fi
|
||||
|
||||
PUBLIC_DIR="/var/public"
|
||||
|
||||
UsePublicDir()
|
||||
{
|
||||
if [ -z "$USE_PUBLIC_DIR" ]; then
|
||||
echo "Don't use public dir"
|
||||
return 1
|
||||
fi
|
||||
if [ ! -d "$PUBLIC_DIR" ];then
|
||||
echo "Not found $PUBLIC_DIR"
|
||||
return 1
|
||||
fi
|
||||
if [ ! -r "$PUBLIC_DIR" ];then
|
||||
echo "Can't read for $PUBLIC_DIR"
|
||||
return 1
|
||||
fi
|
||||
if [ ! -w "$PUBLIC_DIR" ];then
|
||||
echo "Can't write for $PUBLIC_DIR"
|
||||
return 1
|
||||
fi
|
||||
if [ ! -x "$PUBLIC_DIR" ];then
|
||||
echo "Can't excute for $PUBLIC_DIR"
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
WINE_BOTTLE="$HOME/.deepinwine"
|
||||
|
||||
if UsePublicDir;then
|
||||
WINE_BOTTLE="$PUBLIC_DIR"
|
||||
fi
|
||||
|
||||
get_wine_by_pid()
|
||||
{
|
||||
wine_path=$(cat /proc/$1/maps | grep -E "\/wine$|\/wine64$|\/wine |\/wine64 " | head -1 | awk '{print $6}')
|
||||
if [ -z "$wine_path" ];then
|
||||
cat /proc/$1/cmdline| xargs -0 -L1 -I{} echo {} | grep -E "\/wine$|\/wine64$|\/wine |\/wine64 " | head -1
|
||||
else
|
||||
echo $wine_path
|
||||
fi
|
||||
}
|
||||
|
||||
is_wine_process()
|
||||
{
|
||||
wine_module=$(get_wine_by_pid $1)
|
||||
if [ -z "$wine_module" ];then
|
||||
wine_module=$(cat /proc/$1/maps | grep -E "\/wineserver$" | head -1)
|
||||
fi
|
||||
echo $wine_module
|
||||
}
|
||||
|
||||
get_prefix_by_pid()
|
||||
{
|
||||
WINE_PREFIX=$(xargs -0 printf '%s\n' < /proc/$1/environ | grep WINEPREFIX)
|
||||
WINE_PREFIX=${WINE_PREFIX##*=}
|
||||
if [ -z "$WINE_PREFIX" ] && [ -n "$(is_wine_process $1)" ]; then
|
||||
#不指定容器的情况用默认容器目录
|
||||
WINE_PREFIX="$HOME/.wine"
|
||||
fi
|
||||
if [ -n "$WINE_PREFIX" ];then
|
||||
WINE_PREFIX=$(realpath $WINE_PREFIX)
|
||||
echo $WINE_PREFIX
|
||||
fi
|
||||
}
|
||||
|
||||
get_wineserver()
|
||||
{
|
||||
if [ -z "$1" ];then
|
||||
return
|
||||
fi
|
||||
targ_prefix=$(realpath $1)
|
||||
ps -ef | grep wineserver | while read server_info ;do
|
||||
debug_log_to_file "get server info: $server_info"
|
||||
server_pid=$(echo $server_info | awk '{print $2}')
|
||||
server_prefix=$(get_prefix_by_pid $server_pid)
|
||||
debug_log_to_file "get server pid $server_pid, prefix: $server_prefix"
|
||||
|
||||
if [ "$targ_prefix" = "$server_prefix" ];then
|
||||
server=$(echo $server_info | awk '{print $NF}')
|
||||
if [ "-p0" = "$server" ];then
|
||||
server=$(echo $server_info | awk '{print $(NF-1)}')
|
||||
fi
|
||||
debug_log_to_file "get server $server"
|
||||
echo $server
|
||||
return
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
init_log_file()
|
||||
{
|
||||
if [ -d "$DEBUG_LOG" ];then
|
||||
LOG_DIR=$(realpath $DEBUG_LOG)
|
||||
if [ -d "$LOG_DIR" ];then
|
||||
LOG_FILE="${LOG_DIR}/${LOG_FILE##*/}.log"
|
||||
echo "" > "$LOG_FILE"
|
||||
debug_log "LOG_FILE=$LOG_FILE"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
debug_log_to_file()
|
||||
{
|
||||
if [ -d "$DEBUG_LOG" ];then
|
||||
strDate=$(date)
|
||||
echo -e "${strDate}:${1}" >> "$LOG_FILE"
|
||||
fi
|
||||
}
|
||||
|
||||
debug_log()
|
||||
{
|
||||
strDate=$(date)
|
||||
echo "${strDate}:${1}"
|
||||
}
|
||||
|
||||
init_log_file
|
||||
|
||||
get_bottle_path_by_process_id()
|
||||
{
|
||||
PID_LIST="$1"
|
||||
PREFIX_LIST=""
|
||||
|
||||
for pid_var in $PID_LIST ; do
|
||||
WINE_PREFIX=$(get_prefix_by_pid $pid_var)
|
||||
#去掉重复项
|
||||
for path in $(echo -e $PREFIX_LIST) ; do
|
||||
if [[ $path == "$WINE_PREFIX" ]]; then
|
||||
WINE_PREFIX=""
|
||||
fi
|
||||
done
|
||||
if [ -d "$WINE_PREFIX" ]; then
|
||||
debug_log_to_file "found $pid_var : $WINE_PREFIX"
|
||||
PREFIX_LIST+="\n$WINE_PREFIX"
|
||||
fi
|
||||
done
|
||||
echo -e $PREFIX_LIST
|
||||
}
|
||||
|
||||
get_pid_by_process_name()
|
||||
{
|
||||
PID_LIST=""
|
||||
for pid_var in $(ps -ef | grep -E -i "$1" | grep -v grep | awk '{print $2}');do
|
||||
#通过判断是否加载wine来判断是不是wine进程
|
||||
if [ -n "$(is_wine_process $pid_var)" ];then
|
||||
PID_LIST+=" $pid_var"
|
||||
fi
|
||||
done
|
||||
echo "$PID_LIST"
|
||||
}
|
||||
|
||||
get_bottle_path_by_process_name()
|
||||
{
|
||||
PID_LIST=$(get_pid_by_process_name $1)
|
||||
debug_log_to_file "get pid list: $PID_LIST"
|
||||
get_bottle_path_by_process_id "$PID_LIST"
|
||||
}
|
||||
|
||||
get_bottle_path()
|
||||
{
|
||||
if [ -z "$1" ];then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ -f "$1/user.reg" ]; then
|
||||
realpath "$1"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ -f "$WINE_BOTTLE/$1/user.reg" ]; then
|
||||
realpath "$WINE_BOTTLE/$1"
|
||||
return 0
|
||||
fi
|
||||
get_bottle_path_by_process_name "$1"
|
||||
}
|
||||
|
||||
kill_app()
|
||||
{
|
||||
debug_log "try to kill $1"
|
||||
for path in $(get_bottle_path $1); do
|
||||
if [ -n "$path" ];then
|
||||
WINESERVER=$(get_wineserver "$path")
|
||||
|
||||
if [ -f "$WINESERVER" ];then
|
||||
debug_log "kill $path by $WINESERVER"
|
||||
env WINEPREFIX="$path" "$WINESERVER" -k
|
||||
fi
|
||||
|
||||
PID_LIST=$(get_pid_by_process_name "exe|wine")
|
||||
for tag_pid in $PID_LIST; do
|
||||
bottle=$(get_bottle_path_by_process_id "$tag_pid")
|
||||
bottle=${bottle:1}
|
||||
if [ "$path" = "$bottle" ];then
|
||||
echo "kill $tag_pid for $bottle"
|
||||
kill -9 $tag_pid
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
#Kill defunct process
|
||||
ps -ef | grep -E "$USER.*exe.*<defunct>"
|
||||
ps -ef | grep -E "$USER.*exe.*<defunct>" | grep -v grep | awk '{print $2}' | xargs -i kill -9 {}
|
||||
}
|
||||
|
||||
get_tray_window()
|
||||
{
|
||||
$SHELL_DIR/get_tray_window | grep window_id: | awk -F: '{print $2}'
|
||||
}
|
||||
|
||||
get_stacking_window()
|
||||
{
|
||||
xprop -root _NET_CLIENT_LIST_STACKING | awk -F# '{print $2}' | sed -e 's/, / /g'
|
||||
}
|
||||
|
||||
get_window_pid()
|
||||
{
|
||||
for winid in $(echo "$1" | sed -e 's/ /\n/g') ;
|
||||
do
|
||||
xprop -id $winid _NET_WM_PID | awk -F= '{print $2}'
|
||||
done
|
||||
}
|
||||
|
||||
get_window_bottle()
|
||||
{
|
||||
debug_log_to_file "get_window_bottle $1"
|
||||
PID_LIST=$(get_window_pid "$1")
|
||||
debug_log_to_file "get_window_bottle pid list: $PID_LIST"
|
||||
get_bottle_path_by_process_id "$PID_LIST"
|
||||
}
|
||||
|
||||
get_active_bottles()
|
||||
{
|
||||
TRAYWINDOWS=$(get_tray_window)
|
||||
STACKINGWINDOWS=$(get_stacking_window)
|
||||
debug_log_to_file "tray window id: $TRAYWINDOWS"
|
||||
debug_log_to_file "stacking window id: $STACKINGWINDOWS"
|
||||
PID_LIST="$TRAYWINDOWS $STACKINGWINDOWS"
|
||||
get_window_bottle "$PID_LIST"
|
||||
}
|
||||
|
||||
kill_exit_block_app()
|
||||
{
|
||||
TAGBOTTLE=$(get_bottle_path $1)
|
||||
debug_log "tag bottle: $TAGBOTTLE"
|
||||
ACTIVEBOTTLES=$(get_active_bottles)
|
||||
debug_log "active bottles: $ACTIVEBOTTLES"
|
||||
|
||||
if [[ "$ACTIVEBOTTLES" != *"$TAGBOTTLE"* ]]; then
|
||||
kill_app "$TAGBOTTLE"
|
||||
fi
|
||||
}
|
||||
|
||||
#get_active_bottles
|
||||
#exit
|
||||
|
||||
debug_log "kill $1 $2"
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
APP_NAME="$1"
|
||||
fi
|
||||
|
||||
if [ "$2" = "block" ]; then
|
||||
kill_exit_block_app $APP_NAME $3
|
||||
else
|
||||
kill_app $APP_NAME
|
||||
fi
|
||||
""",
|
||||
"postrm": f"""#!/bin/bash
|
||||
if [ "$1" = "remove" ] || [ "$1" = "purge" ];then
|
||||
|
||||
echo "清理卸载残留"
|
||||
for username in `ls /home`
|
||||
CONTAINER_NAME="{e5_text.text()}"
|
||||
|
||||
if [ -z $CONTAINER_NAME ];then
|
||||
echo "W: 没有指定容器,跳过清理容器。请手动前往 ~/.deepinwine/ 下删除"
|
||||
exit
|
||||
fi
|
||||
|
||||
/opt/apps/{e1_text.text()}/kill.sh $CONTAINER_NAME
|
||||
###这里注意,如果没写CONTAINER_NAME,会把QQ杀了
|
||||
|
||||
for username in $(ls /home)
|
||||
do
|
||||
echo /home/$username
|
||||
if [ -d "/home/$username/.deepinwine/{e5_text.text()}" ]
|
||||
then
|
||||
rm -rf "/home/$username/.deepinwine/{e5_text.text()}"
|
||||
fi
|
||||
echo /home/$username
|
||||
if [ -d /home/$username/.deepinwine/$CONTAINER_NAME ]
|
||||
then
|
||||
rm -rf /home/$username/.deepinwine/$CONTAINER_NAME
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "非卸载,跳过清理"
|
||||
fi""",
|
||||
echo "非卸载,跳过清理"
|
||||
fi
|
||||
""",
|
||||
"run_with_box86.sh": f"""#!/bin/bash
|
||||
DEB_PATH="/opt/apps/{e1_text.text()}"
|
||||
WINE="/opt/deepin-wine6-stable/bin/wine"
|
||||
@@ -975,6 +1274,7 @@ Description: {e3_text.text()}
|
||||
if debArch.currentIndex() == 0:
|
||||
write_txt(f"{debPackagePath}/opt/apps/{e1_text.text()}/files/run.sh", debInformation[debArch.currentIndex()]["run.sh"])
|
||||
if debArch.currentIndex() == 1:
|
||||
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/run_with_box86.sh", debInformation[debArch.currentIndex()]["run_with_box86.sh"])
|
||||
write_txt(f"{debPackagePath}/opt/apps/{e1_text.text()}/files/run_with_exagear.sh", debInformation[debArch.currentIndex()]["run_with_exagear.sh"])
|
||||
write_txt("{}/opt/apps/{}/info".format(debPackagePath, e1_text.text()), debInformation[debArch.currentIndex()]["info"])
|
||||
@@ -986,6 +1286,7 @@ Description: {e3_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/{}/files/kill.sh".format(debPackagePath, e1_text.text()))
|
||||
self.run_command("chmod -Rv 755 {}/opt/apps/{}/files/run_with_box86.sh".format(debPackagePath, e1_text.text()))
|
||||
self.run_command("chmod -Rv 755 {}/opt/apps/{}/files/run_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()))
|
||||
@@ -994,7 +1295,7 @@ Description: {e3_text.text()}
|
||||
################
|
||||
if not self.build:
|
||||
self.label.emit("正在构建 deb 包……")
|
||||
self.run_command("bash -c 'dpkg -b {} {}'".format(debPackagePath, e12_text.text()))
|
||||
self.run_command("bash -c 'dpkg -b \"{}\" \"{}\"'".format(debPackagePath, e12_text.text()))
|
||||
################
|
||||
# 完成构建
|
||||
################
|
||||
|
||||
Binary file not shown.
@@ -308,7 +308,11 @@ def get_now_lang()->"获取当前语言":
|
||||
if __name__ == "__main__":
|
||||
localJsonList = []
|
||||
internetJsonList = []
|
||||
internetWineSource = "https://code.gitlink.org.cn/gfdgd_xi/wine-mirrors/raw/branch/master/"
|
||||
internetWineSource = [
|
||||
"https://code.gitlink.org.cn/gfdgd_xi/wine-mirrors/raw/branch/master/",
|
||||
"http://gfdgdxi.msns.cn/wine-mirrors/", # 备用源,纯 IPv6 源
|
||||
"http://127.0.0.1/wine-mirrors/" # 本地测试源
|
||||
][1]
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
# 读取翻译
|
||||
if not get_now_lang() == "zh_CN.UTF-8":
|
||||
|
||||
Reference in New Issue
Block a user