Compare commits

...

9 Commits
2.0.1 ... 2.2

Author SHA1 Message Date
e829b54682 修复wine8下找不到文档的问题 2023-04-19 13:26:47 +08:00
f69c86864f Merge remote-tracking branch 'refs/remotes/origin/master' 2023-04-14 14:47:56 +08:00
53b12e1b8d get_tray_window 2023-04-14 14:47:46 +08:00
1d175af65c runv4忘记改了,私密马赛
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2023-04-13 08:54:33 +00:00
f5d453d699 使用spark_updater 2023-04-13 16:48:07 +08:00
cde60a5892 update spark-dwine-helper/build.sh.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2023-04-13 07:02:51 +00:00
2f41cc88b2 自带kill.sh 2023-04-12 21:49:55 +08:00
b262273a1d wine8 2023-04-12 17:38:28 +08:00
cb80f7be6b update spark-dwine-helper/build.sh.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2023-04-12 09:16:18 +00:00
6 changed files with 369 additions and 13 deletions

View File

@@ -25,7 +25,7 @@ Version: $version
Architecture: all
Maintainer: shenmo <shenmo@spark-app.store>
Installed-Size: $SIZE
Depends: zenity, p7zip-full, fonts-noto-cjk,deepin-wine-helper(>=5.1) | com.wine-helper.deepin,transhell
Depends: zenity, p7zip-full, fonts-noto-cjk,transhell
Section: utils
Priority: extra
Recommends: spark-dwine-helper-settings
@@ -85,7 +85,7 @@ Version: $version
Architecture: all
Maintainer: shenmo <shenmo@spark-app.store>
Installed-Size: $SIZE
Depends: zenity, p7zip-full, fonts-noto-cjk,deepin-wine-helper(>=5.1) | com.wine-helper.deepin,transhell
Depends: zenity, p7zip-full, fonts-noto-cjk,transhell
Section: utils
Priority: extra
Recommends: spark-dwine-helper-settings
@@ -112,11 +112,11 @@ SIZE=`echo ${SIZE%%.*}`
cat << EOF >pkg/DEBIAN/control
Package: spark-dwine-helper-settings
Version: 1.3.1
Version: 1.3.2
Architecture: all
Maintainer: shenmo <shenmo@spark-app.store>
Installed-Size: $SIZE
Depends: spark-dwine-helper(>=1.6),transhell
Depends: spark-dwine-helper(>=1.6),transhell,zenity
Section: utils
Priority: extra
Multi-Arch: foreign

View File

@@ -0,0 +1,28 @@
#!/usr/bin/env python2
# vim: set ts=4 sw=4 fileencoding=utf-8:
# Luomio <nohappiness@gmail.com>
# Filename: dde-first-run.py
# Create Date: 27-03, 13
def get_tray_window():
try:
import gobject
from dbus import glib
import dbus
except ImportError:
return False
gobject.threads_init()
glib.init_threads()
bus = dbus.SessionBus()
traymanager = bus.get_object("com.deepin.dde.TrayManager", "/com/deepin/dde/TrayManager")
windows = traymanager.Get("com.deepin.dde.TrayManager","TrayIcons")
str="window_id:"
for i in xrange(len(windows)):
str += '{:#x} '.format(windows[i])
print(str)
if __name__ == "__main__":
get_tray_window()

View File

@@ -0,0 +1,277 @@
#!/bin/bash
#####因为arm版本的deepin-wine-helper不带这个又不想破坏x86兼容性故改名
APP_NAME="QQ"
LOG_FILE=$0
SHELL_DIR=${0%/*}
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/spark_get_tray_window | 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

View File

@@ -134,7 +134,7 @@ CallProcess()
is_autostart $DEB_PACKAGE_NAME
autostart=$?
if [ $autostart -ne 0 ];then
$SHELL_DIR/kill.sh "$BOTTLENAME" block
$SHELL_DIR/spark_kill.sh "$BOTTLENAME" block
fi
#change current dir to excute path
@@ -148,6 +148,8 @@ CallProcess()
fi
# Disable winemenubuilder
env WINEPREFIX="$WINEPREFIX" $WINE_CMD reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v winemenubuilder.exe /f
# Link to Document
env WINEPREFIX="$WINEPREFIX" $WINE_CMD reg add 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders' /t REG_EXPAND_SZ /v Personal /d "%USERPROFILE%\Documents" /f
debug_log_to_file "Starting process $* ..."
############# WARNING: Here is the modified content: Now will run set-dwine-scale.sh
@@ -254,7 +256,7 @@ CallZhuMu()
CallQQGame()
{
debug_log "run $1"
$SHELL_DIR/kill.sh qqgame block
$SHELL_DIR/spark_kill.sh qqgame block
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$1" &
}
@@ -341,7 +343,7 @@ CallWXWork()
CallDingTalk()
{
debug_log "run $1"
$SHELL_DIR/kill.sh DingTalk block
$SHELL_DIR/spark_kill.sh DingTalk block
CallProcess "$@"
}
@@ -404,7 +406,7 @@ CallFoxmail()
CallTHS()
{
$SHELL_DIR/kill.sh ths block
$SHELL_DIR/spark_kill.sh ths block
debug_log "Start run $1"
#get file full path
@@ -414,7 +416,7 @@ CallTHS()
#kill bloack process
name="${path##*/}"
$SHELL_DIR/kill.sh "$name" block
$SHELL_DIR/spark_kill.sh "$name" block
#change current dir to excute path
path=$(dirname "$path")
@@ -432,7 +434,7 @@ CallTHS()
CallQQGameV2()
{
debug_log "run $1"
$SHELL_DIR/kill.sh QQMicroGameBox block
$SHELL_DIR/spark_kill.sh QQMicroGameBox block
CallProcess "$1" -action:force_download -appid:${2} -pid:8 -bin_version:1.1.2.4 -loginuin:
}
@@ -447,7 +449,7 @@ CallPsCs6()
#kill bloack process
name="${path##*/}"
$SHELL_DIR/kill.sh "$name" block
$SHELL_DIR/spark_kill.sh "$name" block
#change current dir to excute path
path=$(dirname "$path")
@@ -632,7 +634,7 @@ UpdateApp()
esac
ExtractApp "${WINEPREFIX}.tmpdir"
$SHELL_DIR/updater -s "${WINEPREFIX}.tmpdir" -c "${WINEPREFIX}" -v
$SHELL_DIR/spark_updater -s "${WINEPREFIX}.tmpdir" -c "${WINEPREFIX}" -v
rm -rf "${WINEPREFIX}.tmpdir"

View File

@@ -0,0 +1,49 @@
#!/bin/bash
# 检查是否提供了-c和-s选项
if [[ ! "$*" =~ "-c" ]] || [[ ! "$*" =~ "-s" ]]; then
echo "用法: updater -c <目标目录> -s <源目录> [-v]"
exit 1
fi
# 解析命令行参数
while getopts ":c:s:v" opt; do
case $opt in
c)
destination_dir=$OPTARG
;;
s)
source_dir=$OPTARG
;;
v)
verbose=true
;;
\?)
echo "无效选项: -$OPTARG" >&2
exit 1
;;
:)
echo "选项 -$OPTARG 需要一个参数." >&2
exit 1
;;
esac
done
# 从源目录复制文件到目标目录
if [ "$verbose" = true ]; then
echo "正在从 $source_dir 复制文件到 $destination_dir"
fi
# 使用mv命令覆盖同名文件
for file in "$source_dir"/*; do
if [ -f "$file" ]; then
mv -f "$file" "$destination_dir"
if [ "$verbose" = true ]; then
echo "已复制 $file 到 $destination_dir"
fi
fi
done
echo "文件复制完成!"
exit 0

View File

@@ -79,7 +79,7 @@ fi
##############<<<<<<<<<屏蔽mono和gecko安装器开始
##默认屏蔽mono和gecko安装器
if [ "$APPRUN_CMD" = "spark-wine7-devel" ] && [ -z "$ENABLE_DOT_NET" ];then
if [ "$APPRUN_CMD" = "spark-wine7-devel" ] || [ "$APPRUN_CMD" = "spark-wine8" ] && [ -z "$ENABLE_DOT_NET" ];then
export WINEDLLOVERRIDES="mscoree,mshtml="
#### "为了降低打包体积默认关闭gecko和momo如有需要注释此行仅对spark-wine7-devel有效"