mirror of
https://gitee.com/spark-store-project/spark-wine
synced 2025-12-18 13:01:40 +08:00
Compare commits
243 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6f4725118b | |||
| 7460dc7f1d | |||
| 0fd138fee1 | |||
| 4d7dbc82cc | |||
| 8a905f9908 | |||
| 83a04c88ef | |||
| 6c1771c869 | |||
| ada388d347 | |||
| 935c27d04c | |||
| 2d7a7b0c00 | |||
| bfb3ed8b87 | |||
| 84002bd9d5 | |||
| e57bc6e1ae | |||
| 93410c090d | |||
| bff5b2848f | |||
| 8fc7dc9435 | |||
| dfcecf30db | |||
| 3b19f5f26c | |||
| d584b6757b | |||
| a67cf6b6c9 | |||
| f4a3b9ec7f | |||
| 6c59b8378a | |||
| 34eb09779e | |||
| 3481696e75 | |||
| 36c912e762 | |||
| a5893503ed | |||
| d3353b0033 | |||
| 73f28e7c1f | |||
| 6407bf0720 | |||
| 61faeee4fc | |||
| 29629d4dd1 | |||
| 7fc796b0b2 | |||
| 7402323bb5 | |||
| 6218d5f12d | |||
| 248dab68b6 | |||
| 449e84775f | |||
| 7d19e765cb | |||
| c7b766c4e7 | |||
| 7975c46cd4 | |||
| 8d334aebf8 | |||
| 51d0936e2e | |||
| ac3caf46ac | |||
| 03704b2692 | |||
| 222b5f10a6 | |||
| cd2e804407 | |||
| cd1d78b64c | |||
| 0a203effd1 | |||
| 9cfa2f8327 | |||
| 08d12d068e | |||
| 41e3b3265b | |||
| 7f6d469b22 | |||
| 42ddcb2db3 | |||
| 402e571d8d | |||
| 7526b84fe6 | |||
| 9be1a7a739 | |||
| 719ec216f2 | |||
| 00598891ff | |||
| b82aac8f6f | |||
| 65d88b222f | |||
| 1af2d8e446 | |||
| 5898087510 | |||
| 4e54c62c47 | |||
| a23503e298 | |||
| 0705e9c9ab | |||
| 933497abcf | |||
| c0c0ce9a72 | |||
| 67957b914c | |||
| 5ef1f8aef9 | |||
| 05f3d707d0 | |||
| 11e49d7e3d | |||
| f04b5173b7 | |||
| 16eb5abe05 | |||
| 1860bcb111 | |||
| 6a79817a52 | |||
| 65373ab5b1 | |||
| 634953991f | |||
| 37fe68e06a | |||
| 57cdd13cd7 | |||
| 3dbe2e8c0f | |||
| c5c9ecd31e | |||
| 36827d61b6 | |||
| 2a23a978d6 | |||
| 7facfd4355 | |||
| f6740f1adc | |||
| 60fd5dbd95 | |||
| ed10de0220 | |||
| 469f7b5eb6 | |||
| b6f98e0c50 | |||
| 6323758129 | |||
| 392de9c2a2 | |||
| 472a0af1e2 | |||
| 47447c7787 | |||
| e77132f5a7 | |||
| ccc53deceb | |||
| 829a7839eb | |||
| f43db7d6c8 | |||
| a2fd79d9d9 | |||
| 8a44b8da17 | |||
| 304e5ac8e4 | |||
| ef2f8592ae | |||
| 7315456776 | |||
| fddb71eb7d | |||
| 0c5ae361ea | |||
| 2d21b9721a | |||
| 30ef714d71 | |||
| 09711a2199 | |||
|
|
aeb777882e | ||
| 610bbf4ab2 | |||
| 1e1926a500 | |||
| dc23f78232 | |||
|
|
f8efcc9690 | ||
|
|
4733489cd5 | ||
|
|
021a0d6ebd | ||
| 78ab76da83 | |||
|
|
104ed56e1a | ||
| 8fcfd0c5b5 | |||
| 378226dc92 | |||
| 4207be55e2 | |||
| 34698b710e | |||
| 93364b1057 | |||
| 38bca59428 | |||
| e85a14badf | |||
| 16085fe911 | |||
| e829b54682 | |||
| f69c86864f | |||
| 53b12e1b8d | |||
| 1d175af65c | |||
| f5d453d699 | |||
| cde60a5892 | |||
| 2f41cc88b2 | |||
| b262273a1d | |||
| cb80f7be6b | |||
| cd551d8b1c | |||
| 47cdf1548e | |||
| 15223243a1 | |||
| 50438391d8 | |||
| 71d952ad4f | |||
| b655dcaebd | |||
| fc6f0500cb | |||
| f5faa0626b | |||
| f42fd047ca | |||
| 2446a5730d | |||
|
|
545e038c08 | ||
|
|
a21cd7eb88 | ||
|
|
2186616fb6 | ||
|
|
3e40ad7829 | ||
| 71307bfd24 | |||
| 8159a39189 | |||
|
|
5c03d17353 | ||
|
|
5f6c062335 | ||
|
|
069d063031 | ||
|
|
a09f65944c | ||
|
|
2d347d3be3 | ||
|
|
25abbb29b6 | ||
|
|
6e21ae24a4 | ||
|
|
806da4f51b | ||
|
|
f7d7bfe241 | ||
|
|
a615900805 | ||
|
|
308270ddee | ||
|
|
52f5d1a6af | ||
|
|
b8fa265cb7 | ||
|
|
329a783374 | ||
| a0c73e3f92 | |||
|
|
ce53400e78 | ||
| 9b09272e73 | |||
| 7205faad3c | |||
|
|
1dd8abe2c6 | ||
|
|
88acc48015 | ||
| 2f56cd05a6 | |||
| 1335bb9d02 | |||
| b127c26b3d | |||
| 75df70235a | |||
| c7f510202d | |||
| de07b48d36 | |||
| 18fed0ace9 | |||
| b4e5f8d74f | |||
|
|
452caaa5da | ||
| c14bc5081f | |||
| b6695cbd37 | |||
| 8dfdedefdc | |||
| 63a781a703 | |||
| 2ba6e5a135 | |||
| 5ac9a2c907 | |||
| b9d52c2e85 | |||
| ac923c3349 | |||
|
|
4ce18687e5 | ||
|
|
2f703b413d | ||
| 788cf76655 | |||
| dae6f3dd65 | |||
| 4c0c6c3e62 | |||
| 8a41c4e86c | |||
|
|
3411fe4fab | ||
| 13620cb464 | |||
| 1af6f3d759 | |||
| 623c006cbe | |||
|
|
b23682d424 | ||
| f600ec56af | |||
|
|
766a975b34 | ||
|
|
7f8759510f | ||
| 8485c66a87 | |||
| 8e5ddd4215 | |||
| c5f8c2308a | |||
| 08f2da0038 | |||
| 57a3262264 | |||
| e893040b98 | |||
| 3e36c11e88 | |||
| 14f366bb46 | |||
| cbf7dbd838 | |||
| 6c672fdf55 | |||
| b48c1adad9 | |||
| 52fcf57512 | |||
| 46d8e02d9c | |||
| 0a0d3f4055 | |||
| a3b83b1b91 | |||
| 6694c47fe4 | |||
| 04b3e1dd9b | |||
| 09dadd36e8 | |||
| 18845940e1 | |||
| d8671e5863 | |||
| c863f369b6 | |||
| 3ec2118ddb | |||
| 93f096bca5 | |||
| 43e11b2e7f | |||
| 39be413b97 | |||
| 63b63d7cfa | |||
| ec73153de1 | |||
| 6ad27cca3f | |||
| ad9535b5a0 | |||
| e6673676bd | |||
| 01761b00ab | |||
| c6c116c88d | |||
| b1f482a5b1 | |||
| 5baea85c51 | |||
| 529f0a33d8 | |||
| 69e4fea0ee | |||
| 932a3e2288 | |||
| 27727cc5eb | |||
| 931bcc5909 | |||
| 7f293ea0dd | |||
| e025621c56 | |||
| 28a30f2756 | |||
| b1e08edfbe | |||
| 0afae32bce |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.deb
|
||||
@@ -2,3 +2,11 @@
|
||||
|
||||
#### 介绍
|
||||
Modify deepin-wine to make it perform better
|
||||
|
||||
#### 如何加入应用适配
|
||||
|
||||
把适配文件放入`/opt/deepinwine/tools/spark_run_v4_app_configs/$BOTTLENAME.sh`即可
|
||||
|
||||
具体编写方式请参考 https://gitee.com/deepin-community-store/spark-wine/tree/master/spark-dwine-helper/s-wine-helper/deepinwine/tools/spark_run_v4_app_configs
|
||||
|
||||
推荐使用包名作为bottle名以避免重名
|
||||
|
||||
1
dwine-helper-backup/README.txt
Normal file
1
dwine-helper-backup/README.txt
Normal file
@@ -0,0 +1 @@
|
||||
这是一个原版的run_v4留档,以后deepin更新的时候用来diff,这样转spark_run_v4会比较方便
|
||||
@@ -1,15 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2016 Deepin, Inc.
|
||||
# Copyright (C) 2022 The Spark Project
|
||||
#
|
||||
# Author: Li LongYu <lilongyu@linuxdeepin.com>
|
||||
# Peng Hao <penghao@linuxdeepin.com>
|
||||
#
|
||||
# Modifier: shenmo <shenmo@spark-app.store>
|
||||
# sgb76 <sgb76@163.com >
|
||||
# diff: Now will run set-dwine-scale.sh in stage RunApp before CallApp
|
||||
#
|
||||
|
||||
WINEPREFIX="$HOME/.deepinwine/@public_bottle_name@"
|
||||
APPDIR="/opt/deepinwine/apps/@public_bottle_name@"
|
||||
APPVER="@deb_version_string@"
|
||||
@@ -481,7 +476,6 @@ DeployApp()
|
||||
fi
|
||||
|
||||
echo "$APPVER" > "$WINEPREFIX/PACKAGE_VERSION"
|
||||
|
||||
}
|
||||
RemoveApp()
|
||||
{
|
||||
@@ -538,9 +532,6 @@ RunApp()
|
||||
else
|
||||
DeployApp | progressbar $BOTTLENAME "初始化$BOTTLENAME中..."
|
||||
fi
|
||||
############# WARNING: Here is the modified content: Now will run set-dwine-scale.sh
|
||||
/opt/durapps/spark-dwine-helper/set-dwine-scale.sh "$WINEPREFIX"
|
||||
|
||||
CallApp "$@"
|
||||
}
|
||||
|
||||
107
spark-dwine-helper/build.sh
Executable file
107
spark-dwine-helper/build.sh
Executable file
@@ -0,0 +1,107 @@
|
||||
#/bin/bash
|
||||
DEPEND=`dpkg -l | grep fakeroot`
|
||||
if [ "$DEPEND" = "" ] ; then
|
||||
echo "未安装依赖:fakeroot 本脚本退出"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "无参数,无法启动。用法 $0 版本号"
|
||||
echo "No option detected, exit. Usage: $0 version"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
version="$1"
|
||||
######################################################
|
||||
echo "build debian package"
|
||||
mkdir -p pkg/DEBIAN
|
||||
cp -r ./s-wine-helper/* pkg/
|
||||
SIZE=`du -s ./pkg`
|
||||
SIZE=`echo ${SIZE%%.*}`
|
||||
|
||||
cat << EOF >pkg/DEBIAN/control
|
||||
Package: spark-dwine-helper
|
||||
Version: $version
|
||||
Architecture: all
|
||||
Maintainer: shenmo <shenmo@spark-app.store>
|
||||
Installed-Size: $SIZE
|
||||
Depends: zenity, p7zip-legacy (>= 16.02+dfsg-8+Mejituu-2024022216) | p7zip-full (<< 16.02+transitional.1), fonts-noto-cjk, transhell, python3, wmctrl
|
||||
Recommends: python3-pyqt5
|
||||
Section: utils
|
||||
Priority: extra
|
||||
Multi-Arch: foreign
|
||||
Provides: store.spark-app.spark-dwine-helper(=$version)
|
||||
Replaces: store.spark-app.spark-dwine-helper(<=$version)
|
||||
Homepage: https://gitee.com/deepin-community-store/spark-wine
|
||||
Description: Spark Deepin Wine Helper
|
||||
|
||||
|
||||
EOF
|
||||
|
||||
|
||||
cp postinst pkg/DEBIAN/postinst
|
||||
cp prerm pkg/DEBIAN/prerm
|
||||
|
||||
chmod +x pkg/DEBIAN/postinst
|
||||
chmod +x pkg/DEBIAN/prerm
|
||||
cd pkg && fakeroot dpkg-deb -Z xz -b . ../
|
||||
cd ..
|
||||
|
||||
echo "普通deb包已经准备好,正在生成UOS deb包"
|
||||
#################################################################
|
||||
|
||||
|
||||
|
||||
cat << EOF >pkg/opt/apps/store.spark-app.spark-dwine-helper/info
|
||||
{
|
||||
"appid": "store.spark-app.spark-dwine-helper",
|
||||
"name": "store.spark-app.spark-dwine-helper",
|
||||
"version": "$version",
|
||||
"arch": ["amd64,arm64"],
|
||||
"permissions": {
|
||||
"autostart": false,
|
||||
"notification": false,
|
||||
"trayicon": false,
|
||||
"clipboard": false,
|
||||
"account": false,
|
||||
"bluetooth": false,
|
||||
"camera": false,
|
||||
"audio_record": false,
|
||||
"installed_apps": false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
EOF
|
||||
|
||||
SIZE=`du -s ./pkg`
|
||||
SIZE=`echo ${SIZE%%.*}`
|
||||
|
||||
cat << EOF >pkg/DEBIAN/control
|
||||
Package: store.spark-app.spark-dwine-helper
|
||||
Version: $version
|
||||
Architecture: all
|
||||
Maintainer: shenmo <shenmo@spark-app.store>
|
||||
Installed-Size: $SIZE
|
||||
Depends: zenity, p7zip-legacy (>= 16.02+dfsg-8+Mejituu-2024022216) | p7zip-full (<< 16.02+transitional.1), fonts-noto-cjk, transhell, python3
|
||||
Recommends: wmctrl,python3-pyqt5
|
||||
Section: utils
|
||||
Priority: extra
|
||||
Provides: spark-dwine-helper(=$version)
|
||||
Conflicts: spark-dwine-helper
|
||||
Replaces: spark-dwine-helper(<=$version)
|
||||
Multi-Arch: foreign
|
||||
Homepage: https://gitee.com/deepin-community-store/spark-wine
|
||||
Description: Spark Deepin Wine Helper
|
||||
|
||||
|
||||
|
||||
EOF
|
||||
cd pkg && fakeroot dpkg-deb -Z xz -b . ../
|
||||
cd ..
|
||||
|
||||
echo "UOS deb包已经准备好"
|
||||
rm -rf pkg/
|
||||
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
Package: spark-dwine-helper
|
||||
Version: 1.2
|
||||
Architecture: all
|
||||
Maintainer: shenmo <shenmo@spark-app.store>
|
||||
Installed-Size: 2293
|
||||
Depends: zenity:amd64, p7zip-full:amd64, fonts-noto-cjk,deepin-wine-helper(>=5.1)
|
||||
Section: utils
|
||||
Priority: extra
|
||||
Multi-Arch: foreign
|
||||
Homepage: https://www.spark-app.store/
|
||||
Description: Spark Deepin Wine Helper
|
||||
@@ -1,128 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
help() {
|
||||
cat <<EOF
|
||||
用法:$0 [-h|--help] [-s|--set-scale-factor] path
|
||||
-h|--help 显示这个帮助
|
||||
-s|--set-scale-factor 直接指定缩放。支持1.0,1.25,1.5,2.0
|
||||
path 容器目录
|
||||
|
||||
|
||||
--------------------------------------------------------------------
|
||||
Usage: $0 [-h|--help] [-s|--set-scale-factor] path
|
||||
-h|--help Show this text
|
||||
-s|--set-scale-factor Set scale factor direcly. Support 1.0,1.25,1.5,2.0
|
||||
path Wine Container directory path
|
||||
|
||||
|
||||
EOF
|
||||
}
|
||||
#########################帮助文件结束#############################
|
||||
|
||||
parse_args() {
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
help
|
||||
exit
|
||||
;;
|
||||
-s|--set-scale-factor)
|
||||
scale_factor="$2"
|
||||
;;
|
||||
*)
|
||||
CONTAINER_PATH="$1"
|
||||
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
}
|
||||
################
|
||||
parse_args "$@"
|
||||
|
||||
|
||||
#####先看看PATH对不对
|
||||
if [ ! -f "$CONTAINER_PATH/user.reg" ];then
|
||||
echo "错误:找不到user.reg,退出。你应当在文件解压结束后调用此脚本"
|
||||
echo "E: Can not find user.reg. Exit. You should use this script after the extraction"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
if [ "$scale_factor" = "" ];then
|
||||
#########未指定下
|
||||
until [ "$env_dwine_scale" != "" ];do
|
||||
|
||||
env_dwine_scale=`echo $DEEPIN_WINE_SCALE`
|
||||
if [ "$env_dwine_scale" = "" ];then
|
||||
echo "E: No DEEPIN_WINE_SCALE found. Use spark-get-scale to Set "
|
||||
echo "错误:没有检测到DEEPIN_WINE_SCALE,用spark-get-scale设置"
|
||||
/opt/durapps/spark-dwine-helper/spark-get-scale.sh
|
||||
env_dwine_scale=`cat ~/.config/spark-wine/scale.txt`
|
||||
echo "检测到的缩放倍数为:$env_dwine_scale"
|
||||
echo "Scale is $env_dwine_scale"
|
||||
|
||||
else
|
||||
echo "检测到的缩放倍数为:$env_dwine_scale"
|
||||
echo "Scale is $env_dwine_scale"
|
||||
fi
|
||||
|
||||
done
|
||||
#####非deepin发行版似乎没有这个变量,暂时不清楚这个变量是哪个组件做的
|
||||
|
||||
else
|
||||
#######指定了缩放倍数
|
||||
echo "使用了--set-scale-factor,直接指定"
|
||||
echo "--set-scale-factor detected. Arrange directly"
|
||||
|
||||
|
||||
if [ "$scale_factor" != "1.0" ] && [ "$scale_factor" != "1.25" ] && [ "$scale_factor" != "1.5" ] && [ "$scale_factor" != "2.0" ] ;then
|
||||
echo "无法识别的倍数:$scale_factor,请参看$0 -h"
|
||||
echo "Unrecognizable number. Use $0 -h to get help"
|
||||
exit 1
|
||||
fi
|
||||
#######没问题了再用
|
||||
env_dwine_scale=`echo $scale_factor`
|
||||
|
||||
|
||||
fi
|
||||
|
||||
########开始设置
|
||||
case "$env_dwine_scale" in
|
||||
1.0)
|
||||
reg_text="\"LogPixels\"=dword:00000060"
|
||||
;;
|
||||
1.25)
|
||||
reg_text="\"LogPixels\"=dword:00000078"
|
||||
;;
|
||||
1.5)
|
||||
reg_text="\"LogPixels\"=dword:00000090"
|
||||
;;
|
||||
2.0)
|
||||
reg_text="\"LogPixels\"=dword:000000C0"
|
||||
;;
|
||||
*)
|
||||
reg_text="\"LogPixels\"=dword:00000060"
|
||||
#可能不是Xorg
|
||||
;;
|
||||
esac
|
||||
|
||||
#####根据scale设置dword值
|
||||
|
||||
|
||||
LogPixels_line=(`sed -n -e "/"LogPixels"/=" $CONTAINER_PATH/user.reg`)
|
||||
#####关键词行数取得
|
||||
until [ "${#LogPixels_line[@]}" = "0" ];do
|
||||
|
||||
|
||||
line_num=${LogPixels_line[0]}
|
||||
|
||||
sed -i "$line_num"c\ "$reg_text" "$CONTAINER_PATH/user.reg"
|
||||
LogPixels_line=(${LogPixels_line[@]:1})
|
||||
done
|
||||
|
||||
echo "已经完成替换。位置:$CONTAINER_PATH/user.reg"
|
||||
echo "在以下行数进行了替换,内容为$reg_text"
|
||||
echo `sed -n -e "/"LogPixels"/=" $CONTAINER_PATH/user.reg`
|
||||
echo "---------------------------------------"
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
#/bin/bash
|
||||
|
||||
mkdir -p ~/.config/spark-wine/
|
||||
|
||||
|
||||
Get_Dist_Name()
|
||||
{
|
||||
if grep -Eqii "Deepin" /etc/issue || grep -Eq "Deepin" /etc/*-release; then
|
||||
DISTRO='Deepin'
|
||||
elif grep -Eqi "Uniontech" /etc/issue || grep -Eq "Uniontech" /etc/*-release; then
|
||||
DISTRO='UniontechOS'
|
||||
|
||||
fi
|
||||
}
|
||||
Get_Dist_Name
|
||||
if [ "$DISTRO" = "Deepin" ] || [ "$DISTRO" = "UniontechOS" ];then
|
||||
echo 1.0 > ~/.config/spark-wine/scale.txt
|
||||
#####就是1倍缩放
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ -f "~/.config/spark-wine/scale.txt" ];then
|
||||
echo "设置过了,直接读"
|
||||
exit
|
||||
fi
|
||||
|
||||
dimensions=`xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/'`
|
||||
scale_factor=`zenity --list \
|
||||
--width=700 \
|
||||
--height=300 \
|
||||
--title="您的分辨率是:$dimensions,请在以下选项中选择一个以运行应用" \
|
||||
--column="缩放倍率" \
|
||||
1.0 \
|
||||
1.25 \
|
||||
1.5 \
|
||||
2.0`
|
||||
|
||||
case "$scale_factor" in
|
||||
"")
|
||||
zenity --info --text="默认为1倍缩放。您可以随时删除~/.config/spark-wine/scale.txt来重新设置"
|
||||
scale_factor="1.0"
|
||||
;;
|
||||
*)
|
||||
zenity --info --text="缩放倍数为$scale_factor。已保存!您可以随时删除~/.config/spark-wine/scale.txt来重新设置" --width=500 --height=150
|
||||
;;
|
||||
esac
|
||||
echo "$scale_factor" > ~/.config/spark-wine/scale.txt
|
||||
|
||||
7
spark-dwine-helper/postinst
Normal file
7
spark-dwine-helper/postinst
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
if [ ! -d /opt/deepinwine/tools ];then
|
||||
mkdir -p /opt/deepinwine/tools
|
||||
fi
|
||||
|
||||
ln -svf /opt/spark-dwine-helper/spark_run_v4.sh /opt/deepinwine/tools/spark_run_v4.sh
|
||||
ln -svf /opt/spark-dwine-helper/spark_kill.sh /opt/deepinwine/tools/spark_kill.sh
|
||||
5
spark-dwine-helper/prerm
Normal file
5
spark-dwine-helper/prerm
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
unlink /opt/deepinwine/tools/spark_run_v4.sh
|
||||
unlink /opt/deepinwine/tools/spark_kill.sh
|
||||
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
log.warn() { echo -e "[\e[33mWARN\e[0m]: \e[1m$*\e[0m"; }
|
||||
log.error() { echo -e "[\e[31mERROR\e[0m]: \e[1m$*\e[0m"; }
|
||||
log.info() { echo -e "[\e[96mINFO\e[0m]: \e[1m$*\e[0m"; }
|
||||
log.debug() { echo -e "[\e[32mDEBUG\e[0m]: \e[1m$*\e[0m"; }
|
||||
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
##load transhell
|
||||
function load_transhell_debug()
|
||||
{
|
||||
local WORK_PATH="$(dirname $(realpath $0))"
|
||||
echo $WORK_PATH
|
||||
local CURRENT_LANG="$(echo ${LANG%.*})"
|
||||
if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell; echo "Loading transhell from /usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell ..."; fi
|
||||
if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell; echo "Loading transhell from /usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell ..."; fi
|
||||
if [ -e "${WORK_PATH}/transhell/$(basename $0)_en_US.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_en_US.transhell; echo "Loading transhell from ${WORK_PATH}/transhell/$(basename $0)_en_US.transhell ..."; fi
|
||||
if [ -e "${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell; echo "Loading transhell from ${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell ..."; fi
|
||||
|
||||
echo "-----------------------------------------------------------------------------"
|
||||
}
|
||||
|
||||
function load_transhell()
|
||||
{
|
||||
local WORK_PATH="$(dirname $(realpath $0))"
|
||||
local CURRENT_LANG="$(echo ${LANG%.*})"
|
||||
if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell; fi
|
||||
if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell; fi
|
||||
if [ -e "${WORK_PATH}/transhell/$(basename $0)_en_US.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_en_US.transhell; fi
|
||||
if [ -e "${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell; fi
|
||||
|
||||
}
|
||||
|
||||
function update_transhell()
|
||||
{
|
||||
load_transhell $@
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 195 KiB |
@@ -0,0 +1,127 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import subprocess
|
||||
import threading
|
||||
from PyQt5.QtGui import *
|
||||
from PyQt5.QtCore import *
|
||||
from PyQt5.QtWidgets import *
|
||||
|
||||
|
||||
|
||||
|
||||
def check_window():
|
||||
# 使用 wmctrl 命令列出所有窗口,并使用 grep 过滤出特定的 WMCLASS
|
||||
windows = subprocess.getoutput(f'wmctrl -lx | grep "{target_wmclass}"')
|
||||
# 如果窗口存在,则关闭提示
|
||||
if windows.replace("\n", "").replace(" ", "") != "":
|
||||
# 提取窗口ID
|
||||
window_id = windows.replace(" ", " ").split(" ")[0]
|
||||
|
||||
print(f"Window with WMCLASS '{target_wmclass}' found")
|
||||
return 1
|
||||
# else:
|
||||
# print(f"Window with WMCLASS '{target_wmclass}' not found.")
|
||||
|
||||
|
||||
def check_wmclass():
|
||||
if timeout:
|
||||
time.sleep(timeout)
|
||||
window.close()
|
||||
return
|
||||
# 循环检测窗口是否存在的函数
|
||||
# 每隔一段时间检测一次窗口是否存在
|
||||
showtimeout = 20 # 为防止因为应用无法打开而无法正常关闭窗口,于是设置 time out
|
||||
while True:
|
||||
if check_window():
|
||||
break
|
||||
# 等待一段时间后再次检测
|
||||
time.sleep(1)
|
||||
AppInfoShowerRefresh()
|
||||
showtimeout -= 1
|
||||
if showtimeout <= 0:
|
||||
break
|
||||
window.close()
|
||||
|
||||
|
||||
timeout = 0
|
||||
if os.getenv("WAYLAND_DISPLAY"):
|
||||
timeout = 3
|
||||
|
||||
if os.system("which wmctrl"):
|
||||
print("No wmctrl installed. Do not check wmclass")
|
||||
timeout = 3
|
||||
|
||||
target_wmclass = os.getenv("WINE_WMCLASS")
|
||||
|
||||
def GetRecommendWindowSize(window: QMainWindow):
|
||||
# 计算屏幕分辨率
|
||||
screen = QGuiApplication.primaryScreen()
|
||||
width = screen.geometry().width()
|
||||
height = screen.geometry().height()
|
||||
# 如果为竖状屏幕
|
||||
if width < height:
|
||||
temp = height
|
||||
height = width
|
||||
width = temp
|
||||
return [int(width / 4), window.geometry().height()]
|
||||
|
||||
def SetWindowSize(window: QMainWindow):
|
||||
# 计算比例
|
||||
size = GetRecommendWindowSize(window)
|
||||
window.resize(size[0], size[1])
|
||||
|
||||
def MoveCenter(window: QMainWindow):
|
||||
# 计算屏幕分辨率
|
||||
screen = QGuiApplication.primaryScreen()
|
||||
width = screen.geometry().width()
|
||||
height = screen.geometry().height()
|
||||
print(window.geometry().height())
|
||||
# 计算窗口坐标
|
||||
window.move(int(width / 2 - window.geometry().width() / 2),
|
||||
int(height / 2.8 - window.geometry().height() / 2)
|
||||
)
|
||||
|
||||
def AppInfoShowerRefresh():
|
||||
global appInfoShowerTime
|
||||
appInfoShower.setText(f"<h3 align='center'>星火Windows应用兼容助手</h3><p align='center'>正在为您启动以下应用:{os.getenv('WINE_APP_NAME')} {'.' * (appInfoShowerTime % 3 + 1)}</p>")
|
||||
|
||||
appInfoShowerTime += 1
|
||||
|
||||
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
|
||||
|
||||
app = QApplication(sys.argv)
|
||||
# 构建窗口
|
||||
window = QMainWindow()
|
||||
widget = QWidget()
|
||||
layout = QGridLayout()
|
||||
|
||||
appInfoShower = QLabel()
|
||||
appInfoShowerTime = 0
|
||||
AppInfoShowerRefresh()
|
||||
|
||||
# GXDE 彩蛋
|
||||
if os.path.exists("/usr/share/gxde-resources/spark-dwine-helper.png"):
|
||||
backgroundImgPath = "/usr/share/gxde-resources/spark-dwine-helper.png"
|
||||
##########
|
||||
if os.path.exists(f"{programPath}/fallback.png"):
|
||||
backgroundImgPath = f"{programPath}/fallback.png"
|
||||
if os.path.exists(f"/opt/apps/{os.getenv('DEB_PACKAGE_NAME')}/files/banner.png"):
|
||||
backgroundImgPath = f"/opt/apps/{os.getenv('DEB_PACKAGE_NAME')}/files/banner.png"
|
||||
window.setWindowTitle("星火Windows应用兼容助手")
|
||||
layout.addWidget(QLabel(f""), 1, 0)
|
||||
layout.addWidget(appInfoShower, 2, 0)
|
||||
layout.addWidget(QLabel(f"<hr>由 Wine 运行器提供支持"), 4, 0)
|
||||
widget.setLayout(layout)
|
||||
window.setCentralWidget(widget)
|
||||
window.setWindowFlags(Qt.CustomizeWindowHint | Qt.WindowStaysOnTopHint)
|
||||
MoveCenter(window)
|
||||
SetWindowSize(window)
|
||||
window.show()
|
||||
|
||||
|
||||
layout.addWidget(QLabel(f"<p align='center'><img width='{window.geometry().width()}' src='{backgroundImgPath}'></p>"), 0, 0)
|
||||
threading.Thread(target=check_wmclass).start()
|
||||
MoveCenter(window)
|
||||
app.exec_()
|
||||
@@ -0,0 +1,92 @@
|
||||
___
|
||||
( )
|
||||
| | .-. ___ ___ .--. .--.
|
||||
| |/ \ ( )( ) / \ / \
|
||||
| .-. . | | | | ; ,-. ' | .-. ;
|
||||
| | | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | |/ |
|
||||
| | | | | | | | | | | | | ' _.'
|
||||
| | | | | | ; ' | ' | | | .'.-.
|
||||
| | | | ' `-' / ' `-' | ' `-' /
|
||||
(___)(___) '.__.' `.__. | `.__.'
|
||||
( `-' ;
|
||||
`.__.
|
||||
___
|
||||
( )
|
||||
| |.-. .---. ___ .-. .--. ___ .-.
|
||||
| / \ / .-, \ ( ) \ / \ ( ) \
|
||||
| .-. | (__) ; | | ' .-. ; | .-. ; | .-. .
|
||||
| | | | .'` | | / (___) | | | | | | | |
|
||||
| | | | / .'| | | | | | | | | | | |
|
||||
| | | | | / | | | | | | | | | | | |
|
||||
| ' | | ; | ; | | | | ' | | | | | |
|
||||
' `-' ; ' `-' | | | ' `-' / | | | |
|
||||
`.__. `.__.'_. (___) `.__.' (___)(___)
|
||||
|
||||
|
||||
___
|
||||
( )
|
||||
| |.-. ___ ___ ___ .-. ___ .-. ___ ___
|
||||
| / \ ( )( ) ( ) \ ( ) \ ( )( )
|
||||
| .-. | | | | | | .-. . | .-. . | | | |
|
||||
| | | | | | | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | | | | ' | |
|
||||
| | | | | | | | | | | | | | | | ' `-' |
|
||||
| ' | | | | ; ' | | | | | | | | `.__. |
|
||||
' `-' ; ' `-' / | | | | | | | | ___ | |
|
||||
`.__. '.__.' (___)(___) (___)(___) ( )' |
|
||||
; `-' '
|
||||
.__.'
|
||||
............ .....]OOOo]`....
|
||||
... ........ ...=OOOOOOOOO\..
|
||||
.../OOOOOOO`.... ..=OOO@/[\OOOOO.
|
||||
..=OOOOOOOOO\... .,@OO^/....O@O@`
|
||||
..OOOOOO[[OOO@`. .=OO@,...=.OOOO.
|
||||
..OOOOO./O^,@OO` .=OO^....,.@OO^.
|
||||
..\OOO@^...=OOOO.... .OOO^*..,`/OOO..
|
||||
...\OOOOOOOooooO^... .=OO^...`=OO@`..
|
||||
..=@O@OooOOOOO@`...........=@@O]].,@O@`...
|
||||
.,@OoOO`...O@^......,]]]]/OOOOOOO@@... .
|
||||
...\OO@]]]OOOO@@@@@@@@@@@@@@@@@@@OO.....
|
||||
.....[@@OOO@@@@@@@@@@@@@@@@@@@@@@@@@@`..
|
||||
..OOO@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@`....
|
||||
.,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\...
|
||||
....=@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@^..
|
||||
...=@@@@@@@@@@@@@@@@@@@@@@`,\@@@@@@@@@@@@@^.
|
||||
..,@@@@@@@@@@@@@@@@@@@@@@@O,[].\@@@@@@@@@@@.
|
||||
../@@@@@@@@@@@@O@@@@@@@@@@@......\@@@@@@@@@^
|
||||
.,@@@@@@@@@@@O`.\@@@@@@@@@/........\@@@@@@@@...
|
||||
.=@@@@@@@@@/.....\@@@@@@@@/`...[O`..\@@@@@@@`...
|
||||
.=@@@@@@@^,O[..,`.,@@@@@/../@@O[`...,@@@@@@@....
|
||||
....@@@@@@@O`,@@O[]..,@/[`..=oo@O`,^...@@@@@@@@`..
|
||||
....O@@@@@@@@`,OOO@^*\.........\..../.../@`.=^..
|
||||
.. ...,@^=@@@^.\`...,^...........[[......O]//...
|
||||
..,\]@@@\...[`....................=@@/....
|
||||
.=@@\............,]/`........../@@@\.. .
|
||||
.....@@@@@\.....................,/@@@@@@\...
|
||||
...=@@@@@@@@\]..............]@@@@@@@@@@@@`.
|
||||
...,@@@@@@@@@@@@@@/[\O@@O/[*./@@@@@@@@@@@@@\.......
|
||||
...@@@@@@@@@@@@@@@^.,O@@@@^../@@@@@@@@@@@@@@@\.....
|
||||
..........@@@@@@@@@@@@@@@@@`..`\/`../@@@@@@@@@@@@@@@@@@@@]]
|
||||
........,@@@@@@@@@@@@@@@@/*[\].,`]/[[@@@@@@@@@@@@@@,[[[[`..
|
||||
..,O\/@@@@@@@@@@@@@@@@@@@`...........O@@O@@@@@@@@@@\....
|
||||
.....\@@@@@@@@@@@@@@@@@@@OO\`,O.. .,@OOO@@@@@@@@@@. ..
|
||||
..../@@@@@@@@@@@@@@OO@`.^,O. ..=@OOO@@@@@@@@@.. .
|
||||
...=@@@@@@@@@@@@@@@@@O[[.... ...\@@@@@@@@@@@/.. .
|
||||
...=@@@@@@@@@@@@@@,^ ....O...\@@@@@@`
|
||||
....@@@@@@@@@@@@@/.. ...^/\]/[\@@@@`.
|
||||
.@@@@/@@@@@@@^O..... ...,@@^]..]@/...
|
||||
...\@`.[@@@@@@...... .=`@@@@@^..^....
|
||||
....`....[@@@O\.[,..........OO@@@@@^.,[[....
|
||||
............\@@@\`...,`**,]@@@@@@@^.........
|
||||
.. .,@@@@@@@@@@@@@@@@@@/...
|
||||
..O@@@@@@@@@@@@@@@@@^...
|
||||
..O@@@@@@^...=@@@@@@@...
|
||||
..@@@@@@@\...=@@@@@@@^..
|
||||
.=@@@@@@@@...=@@@@@@@O..
|
||||
.=@@@@@@@@`..=@@@@@@@@..
|
||||
.=@@@O@@@@^..=@@OO@@@@^.
|
||||
.O@OOOOO@O^..=@OOOOOOO^.
|
||||
.Oo/[\O/\O@..=/[\O/\o*O.
|
||||
.O^......=O...^......*/.
|
||||
.=\.....]O^...\\...]//.. .. ........
|
||||
@@ -0,0 +1,107 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 导入 transhell.bashimport 脚本并加载调试模式
|
||||
source ${SHELL_DIR}/bashimport/transhell.bashimport
|
||||
load_transhell_debug
|
||||
|
||||
#########>>>>>>> 函数段
|
||||
# 获取当前系统的发行版名称
|
||||
Get_Dist_Name()
|
||||
{
|
||||
if grep -Eqii "Deepin" /etc/issue || grep -Eq "Deepin" /etc/*-release; then
|
||||
DISTRO='Deepin'
|
||||
elif grep -Eqi "UnionTech" /etc/issue || grep -Eq "UnionTech" /etc/*-release; then
|
||||
DISTRO='UniontechOS'
|
||||
elif grep -Eqi "GXDE" /etc/issue || grep -Eq "GXDE" /etc/*-release; then
|
||||
DISTRO='GXDE'
|
||||
elif grep -Eqi "UOS" /etc/issue || grep -Eq "UOS" /etc/*-release; then
|
||||
DISTRO='UniontechOS'
|
||||
else
|
||||
DISTRO='OtherOS'
|
||||
fi
|
||||
}
|
||||
|
||||
# 检测常见的缩放环境变量
|
||||
Check_Scale_Env_Vars()
|
||||
{
|
||||
if [ -n "$DEEPIN_WINE_SCALE" ]; then
|
||||
echo "$DEEPIN_WINE_SCALE"
|
||||
return 0
|
||||
elif [ -n "$GDK_SCALE" ]; then
|
||||
echo "$GDK_SCALE"
|
||||
return 0
|
||||
elif [ -n "$QT_SCALE_FACTOR" ]; then
|
||||
echo "$QT_SCALE_FACTOR"
|
||||
return 0
|
||||
elif [ -n "$WINIT_X11_SCALE_FACTOR" ]; then
|
||||
echo "$WINIT_X11_SCALE_FACTOR"
|
||||
return 0
|
||||
elif [ -n "$ELM_SCALE" ]; then
|
||||
echo "$ELM_SCALE"
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
######<<<<<<<
|
||||
|
||||
# 提示全局参数的位置
|
||||
echo "全局参数的位置在 $HOME/.config/spark-wine/scale.txt"
|
||||
|
||||
# 创建配置目录
|
||||
mkdir -p $HOME/.config/spark-wine/
|
||||
|
||||
# 检查是否已经设置过全局参数
|
||||
if [ -f "$HOME/.config/spark-wine/scale.txt" ]; then
|
||||
echo "已经设置过全局参数,使用"
|
||||
echo "全局参数的位置在 $HOME/.config/spark-wine/scale.txt,如果需要更换请删除此文件重新生成"
|
||||
exit
|
||||
fi
|
||||
|
||||
# 检测常见的缩放环境变量
|
||||
scale_value=$(Check_Scale_Env_Vars)
|
||||
if [ -n "$scale_value" ]; then
|
||||
echo "$scale_value" > $HOME/.config/spark-wine/scale.txt
|
||||
echo "检测到缩放环境变量,使用 $scale_value 作为缩放比例"
|
||||
exit
|
||||
fi
|
||||
|
||||
# 如果环境变量未设置,则根据系统发行版设置默认缩放比例
|
||||
Get_Dist_Name
|
||||
if [ "$DISTRO" = "UniontechOS" ] || [ "$DISTRO" = "GXDE" ]; then
|
||||
echo "1.0" > $HOME/.config/spark-wine/scale.txt
|
||||
echo "检测到 UniontechOS 或 GXDE 系统,使用 1.0 作为默认缩放比例"
|
||||
exit
|
||||
fi
|
||||
|
||||
# 获取当前显示器的分辨率
|
||||
dimensions=$(xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/')
|
||||
|
||||
# 使用 Zenity 弹窗让用户选择缩放比例
|
||||
scale_factor=$(zenity --list \
|
||||
--width=700 \
|
||||
--height=350 \
|
||||
--title="${TRANSHELL_CONTENT_YOUR_DIMENSION_IS} $dimensions ${TRANSHELL_CONTENT_PLEASE_CHOOSE_ONE_BELOW}" \
|
||||
--column="${TRANSHELL_CONTENT_OPTION}" \
|
||||
1.0 \
|
||||
1.25 \
|
||||
1.5 \
|
||||
1.75 \
|
||||
2.0 \
|
||||
2.5 \
|
||||
3.0 \
|
||||
3.5 \
|
||||
4.0)
|
||||
|
||||
# 处理用户的选择
|
||||
case "$scale_factor" in
|
||||
"")
|
||||
zenity --info --text="${TRANSHELL_CONTENT_1_SCALE_AS_DEFAULT}${TRANSHELL_CONTENT_YOU_CAN_USE_SPARK_WINE_HELPER_SETTINGS_TO_ADJUST}" --width=500 --height=150
|
||||
scale_factor="1.0"
|
||||
;;
|
||||
*)
|
||||
zenity --info --text="${TRANSHELL_CONTENT_SCALE_IS} $scale_factor ${TRANSHELL_CONTENT_SAVED}!${TRANSHELL_CONTENT_YOU_CAN_USE_SPARK_WINE_HELPER_SETTINGS_TO_ADJUST}" --width=500 --height=150
|
||||
;;
|
||||
esac
|
||||
|
||||
# 将用户选择的缩放比例保存到配置文件中
|
||||
echo "$scale_factor" > $HOME/.config/spark-wine/scale.txt
|
||||
@@ -0,0 +1,140 @@
|
||||
#!/bin/bash
|
||||
|
||||
help() {
|
||||
cat <<EOF
|
||||
用法:$0 [-h|--help] [-s|--set-scale-factor] path
|
||||
-h|--help 显示这个帮助
|
||||
-s|--set-scale-factor 直接指定缩放。支持1.0,1.25,1.5,1.75,2.0,2.5,3.0,3.5,4.0
|
||||
path 容器目录
|
||||
|
||||
本脚本具有超级兔力。
|
||||
--------------------------------------------------------------------
|
||||
Usage: $0 [-h|--help] [-s|--set-scale-factor] path
|
||||
-h|--help Show this text
|
||||
-s|--set-scale-factor Set scale factor direcly. Support 1.0,1.25,1.5,1.75,2.0,2.5,3.0,3.5,4.0
|
||||
path Wine Container directory path
|
||||
|
||||
This script have super bunny power.
|
||||
EOF
|
||||
}
|
||||
#########################帮助文件结束#############################
|
||||
|
||||
parse_args() {
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
help
|
||||
exit
|
||||
;;
|
||||
-s|--set-scale-factor)
|
||||
appointed_scale_factor="$2"
|
||||
|
||||
;;
|
||||
|
||||
"bunny")
|
||||
cat ${SHELL_DIR}/spark-dwine-helper/scale-set-helper/bunny.txt
|
||||
exit
|
||||
|
||||
;;
|
||||
|
||||
*)
|
||||
CONTAINER_PATH="$1"
|
||||
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
}
|
||||
################
|
||||
parse_args "$@"
|
||||
|
||||
|
||||
|
||||
if [ "$appointed_scale_factor" = "" ];then
|
||||
#########未指定下,读取$CONTAINER_PATH/scale.txt。如果没有,优先$DEEPIN_WINE_SCALE设置,然后是手动
|
||||
|
||||
if [ ! -f "$CONTAINER_PATH/scale.txt" ];then
|
||||
|
||||
${SHELL_DIR}/spark-dwine-helper/scale-set-helper/get-scale.sh
|
||||
wine_scale=$(cat $HOME/.config/spark-wine/scale.txt)
|
||||
echo "检测到的缩放倍数为:$wine_scale"
|
||||
echo "Scale is $wine_scale"
|
||||
else
|
||||
wine_scale=`cat $CONTAINER_PATH/scale.txt`
|
||||
|
||||
echo "检测到的缩放倍数为:$wine_scale"
|
||||
echo "Scale is $wine_scale"
|
||||
|
||||
|
||||
fi
|
||||
#####非deepin发行版似乎没有这个变量,暂时不清楚这个变量是哪个组件做的
|
||||
|
||||
|
||||
|
||||
else
|
||||
#######指定了缩放倍数
|
||||
echo "使用了--set-scale-factor,直接指定"
|
||||
echo "--set-scale-factor detected. Arrange directly"
|
||||
|
||||
|
||||
if [ "$appointed_scale_factor" != "1.0" ] && [ "$appointed_scale_factor" != "1.25" ] && [ "$appointed_scale_factor" != "1.5" ] && [ "$appointed_scale_factor" != "1.75" ] && [ "$appointed_scale_factor" != "2.0" ] && [ "$appointed_scale_factor" != "2.5" ] && [ "$appointed_scale_factor" != "3.0" ] && [ "$appointed_scale_factor" != "3.5" ] && [ "$appointed_scale_factor" != "4.0" ];then
|
||||
echo "无法识别的倍数:$appointed_scale_factor,请参看$0 -h"
|
||||
echo "Unrecognizable number. Use $0 -h to get help"
|
||||
exit 1
|
||||
fi
|
||||
#######没问题了再用
|
||||
echo "$appointed_scale_factor" > $CONTAINER_PATH/scale.txt
|
||||
wine_scale=`cat $CONTAINER_PATH/scale.txt`
|
||||
|
||||
fi
|
||||
|
||||
########开始设置
|
||||
########如果环境变量里没指定了APPRUN_CMD(在run.sh中)就替换,如果有就直接用来设置
|
||||
|
||||
if [ "$APPRUN_CMD" = "" ];then
|
||||
echo "没有检测到APPRUN_CMD环境变量,请在环境变量中指定(export),本脚本退出"
|
||||
exit 1
|
||||
|
||||
else
|
||||
#####用wine提供的方法
|
||||
|
||||
case "$wine_scale" in
|
||||
1.0*)
|
||||
dpi="96"
|
||||
;;
|
||||
1.25*)
|
||||
dpi="120"
|
||||
;;
|
||||
1.5*)
|
||||
dpi="144"
|
||||
;;
|
||||
1.75*)
|
||||
dpi="168"
|
||||
;;
|
||||
2.0*)
|
||||
dpi="192"
|
||||
;;
|
||||
2.5*)
|
||||
dpi="240"
|
||||
;;
|
||||
3.0*)
|
||||
dpi="288"
|
||||
;;
|
||||
3.5*)
|
||||
dpi="336"
|
||||
;;
|
||||
4.0*)
|
||||
dpi="384"
|
||||
;;
|
||||
*)
|
||||
dpi="96"
|
||||
#可能不是Xorg或者是其他错误
|
||||
;;
|
||||
esac
|
||||
echo "用$APPRUN_CMD执行指令"
|
||||
echo "指令为"
|
||||
echo "env WINEPREFIX="$CONTAINER_PATH" $APPRUN_CMD reg ADD 'HKCU\Control Panel\Desktop' /v LogPixels /t REG_DWORD /d $dpi /f"
|
||||
|
||||
env WINEPREFIX="$CONTAINER_PATH" $APPRUN_CMD reg ADD 'HKCU\Control Panel\Desktop' /v LogPixels /t REG_DWORD /d $dpi /f
|
||||
|
||||
fi
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
TRANSHELL_CONTENT_OPTION="Options"
|
||||
TRANSHELL_CONTENT_YOUR_DIMENSION_IS="Your dimension is :"
|
||||
TRANSHELL_CONTENT_PLEASE_CHOOSE_ONE_BELOW="Please choose one option below"
|
||||
TRANSHELL_CONTENT_1_SCALE_AS_DEFAULT="Setting 1.0 scale as default"
|
||||
TRANSHELL_CONTENT_SCALE_IS="Scale multiple is "
|
||||
TRANSHELL_CONTENT_SAVED="saved."
|
||||
TRANSHELL_CONTENT_YOU_CAN_USE_SPARK_WINE_HELPER_SETTINGS_TO_ADJUST="You can use spark wine helper settings to adjust settings"
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
TRANSHELL_CONTENT_OPTION="选项"
|
||||
TRANSHELL_CONTENT_YOUR_DIMENSION_IS="您的分辨率是:"
|
||||
TRANSHELL_CONTENT_PLEASE_CHOOSE_ONE_BELOW="请在以下选项中选择一个"
|
||||
TRANSHELL_CONTENT_1_SCALE_AS_DEFAULT="默认为1倍缩放。"
|
||||
TRANSHELL_CONTENT_SCALE_IS="缩放倍数为"
|
||||
TRANSHELL_CONTENT_SAVED="已保存"
|
||||
TRANSHELL_CONTENT_YOU_CAN_USE_SPARK_WINE_HELPER_SETTINGS_TO_ADJUST="您可以使用星火wine助手设置来重新设置"
|
||||
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 定义日志函数
|
||||
log.warn() { echo -e "[\e[33mWARN\e[0m]: \e[1m$*\e[0m"; }
|
||||
log.error() { echo -e "[\e[31mERROR\e[0m]: \e[1m$*\e[0m"; }
|
||||
log.info() { echo -e "[\e[96mINFO\e[0m]: \e[1m$*\e[0m"; }
|
||||
log.debug() { echo -e "[\e[32mDEBUG\e[0m]: \e[1m$*\e[0m"; }
|
||||
|
||||
desktop_dir="${HOME}/.local/share/applications/wine/Programs"
|
||||
|
||||
find "$desktop_dir" -type f -name "*.desktop" | while read -r desktop_file; do
|
||||
log.debug "处理文件: $desktop_file"
|
||||
|
||||
exec_line=$(grep -i '^Exec=' "$desktop_file" | cut -d'=' -f2- | xargs)
|
||||
wineprefix=$(echo "$exec_line" | grep -o 'WINEPREFIX=[^ ]*' | cut -d'=' -f2)
|
||||
|
||||
# 核心修复:使用正则表达式提取完整Windows路径
|
||||
exe_win_path=$(echo "$exec_line" | grep -o 'C:\\\\.*\.lnk' | head -1)
|
||||
|
||||
log.debug "WINEPREFIX: '$wineprefix'"
|
||||
log.debug "原始 Windows 路径: '$exe_win_path'"
|
||||
|
||||
if [[ -z "$wineprefix" || -z "$exe_win_path" ]]; then
|
||||
log.warn "参数不完整,跳过"
|
||||
continue
|
||||
fi
|
||||
|
||||
# 路径转换:处理转义字符和路径分隔符
|
||||
exe_win_path_unix=$(printf "%b" "$exe_win_path" | sed -e 's/\\/\//g' -e 's/^[cC]://')
|
||||
exe_path_unix="${wineprefix}/dosdevices/c:/${exe_win_path_unix}"
|
||||
|
||||
log.debug "转换后的 UNIX 路径: $exe_path_unix"
|
||||
|
||||
if [[ ! -f "$exe_path_unix" ]]; then
|
||||
log.info "文件不存在: $exe_path_unix, 删除 $desktop_file"
|
||||
rm "$desktop_file"
|
||||
else
|
||||
log.debug "文件存在: $exe_path_unix"
|
||||
fi
|
||||
done
|
||||
|
||||
rm -vf ${HOME}/.local/share/applications/wine-*
|
||||
@@ -0,0 +1,12 @@
|
||||
[Desktop Entry]
|
||||
Categories=Utility;
|
||||
Encoding=UTF-8
|
||||
Exec=bash -c "/opt/spark-dwine-helper/spark-dwine-helper/wine-app-launcher/spark-wine-launcher winecfg"
|
||||
Icon=spark-wine-configure
|
||||
MimeType=application/x-ms-dos-executable;application/x-msi;application/x-ms-shortcut;
|
||||
Name=Configure Windows App
|
||||
Name[zh_CN]=Windows 控制面板
|
||||
StartupWMClass=spark-wine-launcher
|
||||
Terminal=False
|
||||
Type=Application
|
||||
NoDisplay=false
|
||||
@@ -0,0 +1,12 @@
|
||||
[Desktop Entry]
|
||||
Categories=Utility;
|
||||
Encoding=UTF-8
|
||||
Exec=bash -c "/opt/spark-dwine-helper/spark-dwine-helper/wine-app-launcher/spark-wine-launcher %F"
|
||||
Icon=spark-wine-launcher
|
||||
MimeType=application/x-ms-dos-executable;application/x-msi;application/x-ms-shortcut;
|
||||
Name=Launch Windows App
|
||||
Name[zh_CN]=启动Windows应用
|
||||
StartupWMClass=spark-wine-launcher
|
||||
Terminal=False
|
||||
Type=Application
|
||||
NoDisplay=true
|
||||
@@ -0,0 +1,13 @@
|
||||
[Desktop Entry]
|
||||
Categories=Utility;
|
||||
Encoding=UTF-8
|
||||
Exec=bash -c "/opt/spark-dwine-helper/spark-dwine-helper/wine-app-launcher/spark-wine-launcher uninstaller"
|
||||
Icon=spark-wine-uninstaller
|
||||
MimeType=
|
||||
Name=Uninstall Windows App
|
||||
Name[zh_CN]=卸载Windows应用
|
||||
NoDisplay=false
|
||||
StartupWMClass=spark-wine-uninstaller
|
||||
Terminal=False
|
||||
Type=Application
|
||||
X-Deepin-Vendor=user-custom
|
||||
@@ -0,0 +1,66 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ===== Log Functions with Colors =====
|
||||
log.warn() { echo -e "[\e[33mWARN\e[0m]: \e[1m$*\e[0m"; }
|
||||
log.error() { echo -e "[\e[31mERROR\e[0m]: \e[1m$*\e[0m"; }
|
||||
log.info() { echo -e "[\e[96mINFO\e[0m]: \e[1m$*\e[0m"; }
|
||||
log.debug() { echo -e "[\e[32mDEBUG\e[0m]: \e[1m$*\e[0m"; }
|
||||
|
||||
# Zenity wrapper function
|
||||
gui_dialog() {
|
||||
if command -v garma &>/dev/null; then
|
||||
garma "$@"
|
||||
else
|
||||
zenity "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
# Check if no arguments were passed
|
||||
if [[ $# -eq 0 ]]; then
|
||||
gui_dialog --info --text="使用方法:\nUsage:\n\nspark-wine9 <application.exe>\n\n请提供要运行的 Windows 应用程序。\nPlease provide the Windows application to run."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if spark-wine9 is installed
|
||||
if [[ ! -e "/usr/bin/spark-wine9" ]]; then
|
||||
gui_dialog --question --text="您尚未安装 spark-wine9 ,是否安装以运行 Windows 应用?\nYou haven't installed spark-wine9 yet. Would you like to install it to run Windows applications?"
|
||||
if [[ $? -ne 0 ]]; then
|
||||
log.error "User refused to install. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# Install spark-wine with progress indicator
|
||||
pkexec bash -c "aptss update && aptss install spark-wine9 spark-wine9-mono -y" | gui_dialog --progress --pulsate --auto-close --no-cancel --text="正在安装,请保持网络畅通,耐心等待\nInstalling, please keep network connection and wait patiently"
|
||||
INSTALL_STATUS=${PIPESTATUS[0]}
|
||||
|
||||
# Check the installation status correctly
|
||||
if [[ $INSTALL_STATUS -ne 0 ]]; then
|
||||
gui_dialog --error --text="安装出错,请手动执行以下指令查看错误并反馈:\nError occurred during installation. Please execute the command below to view the error log:\n\nsudo aptss install spark-wine9 spark-wine9-mono -y"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
fi
|
||||
|
||||
# Run spark-wine with WINEPREFIX
|
||||
export WINEPREFIX="${WINEPREFIX:=$HOME/.deepinwine/spark-wine-custom}"
|
||||
export APPRUN_CMD="/usr/bin/spark-wine9"
|
||||
export SHELL_DIR="/opt/spark-dwine-helper"
|
||||
|
||||
if [[ "$WINEPREFIX" != $HOME/.deepinwine/spark-wine-custom ]];then
|
||||
${APPRUN_CMD} "$@"
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
|
||||
(
|
||||
mkdir -p ${WINEPREFIX}
|
||||
${SHELL_DIR}/spark-dwine-helper/scale-set-helper/set-wine-scale.sh ${WINEPREFIX} &
|
||||
# ${APPRUN_CMD} reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v winemenubuilder.exe /f &
|
||||
wait
|
||||
) | gui_dialog --progress --pulsate --auto-close --no-cancel --text="正在准备应用...\nPreparing Windows APP..."
|
||||
|
||||
${APPRUN_CMD} "$@"
|
||||
/opt/spark-dwine-helper/spark-dwine-helper/spark-wine-desktop-auto-cleanner
|
||||
@@ -0,0 +1,78 @@
|
||||
#/bin/bash
|
||||
SHELL_DIR=$(dirname $(realpath $0))
|
||||
|
||||
source /opt/bashimport/transhell.sh
|
||||
load_transhell_debug
|
||||
|
||||
until [ "$IS_CLOSE" = "1" ];do
|
||||
|
||||
CHOSEN_SETTINGS=`zenity --list \
|
||||
--width=700 \
|
||||
--height=350 \
|
||||
--title="${TRANSHELL_CONTENT_WELCOME_AND_CHOOSE_ONE_TO_RUN}" \
|
||||
--column="${TRANSHELL_CONTENT_OPTION}" \
|
||||
"${TRANSHELL_CONTENT_SET_APP}" \
|
||||
"${TRANSHELL_CONTENT_SET_GLOBAL_SCALE}" \
|
||||
"${TRANSHELL_CONTENT_REMOVE_GLOBAL_SCALE}" \
|
||||
"${TRANSHELL_CONTENT_SYNC_APP_SCALE_WITH_GLOBAL}" \
|
||||
"${TRANSHELL_CONTENT_ONLY_AVAILABLE_TO_SPARK_DWINE_HELPER_APP}" `
|
||||
|
||||
echo "$CHOSEN_SETTINGS"
|
||||
case "$CHOSEN_SETTINGS" in
|
||||
"${TRANSHELL_CONTENT_SET_GLOBAL_SCALE}")
|
||||
########
|
||||
|
||||
|
||||
dimensions=`xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/'`
|
||||
scale_factor=`zenity --list \
|
||||
--width=700 \
|
||||
--height=350 \
|
||||
--title="${TRANSHELL_CONTENT_YOUR_DIMENSION_IS} $dimensions ${TRANSHELL_CONTENT_PLEASE_CHOOSE_ONE_BELOW}" \
|
||||
--column="${TRANSHELL_CONTENT_OPTION}" \
|
||||
1.0 \
|
||||
1.25 \
|
||||
1.5 \
|
||||
1.75 \
|
||||
2.0`
|
||||
|
||||
case "$scale_factor" in
|
||||
"")
|
||||
zenity --info --text="${TRANSHELL_CONTENT_1_SCALE_AS_DEFAULT}" --width=500 --height=150
|
||||
scale_factor="1.0"
|
||||
;;
|
||||
*)
|
||||
zenity --info --text="${TRANSHELL_CONTENT_SCALE_IS} $scale_factor ${TRANSHELL_CONTENT_SAVED}" --width=500 --height=150
|
||||
;;
|
||||
esac
|
||||
echo "$scale_factor" > $HOME/.config/spark-wine/scale.txt
|
||||
|
||||
|
||||
;;
|
||||
########
|
||||
|
||||
|
||||
|
||||
|
||||
"${TRANSHELL_CONTENT_SET_APP}")
|
||||
bash "${SHELL_DIR}/wine-app-launcher.sh"
|
||||
;;
|
||||
"${TRANSHELL_CONTENT_SYNC_APP_SCALE_WITH_GLOBAL}")
|
||||
find ${HOME}/.deepinwine/ -name "scale.txt" -type f -print -exec rm -rf {} \;
|
||||
zenity --info --text="${TRANSHELL_CONTENT_BOTTLES_BELOW_HAVE_SYNCED_SCALE_WITH_GLOBAL}:\n`cd ${HOME}/.deepinwine/ && ls`" --width=500 --height=150
|
||||
;;
|
||||
"${TRANSHELL_CONTENT_REMOVE_GLOBAL_SCALE}")
|
||||
rm -fv $HOME/.config/spark-wine/scale.txt
|
||||
zenity --info --text="${TRANSHELL_CONTENT_REMOVED}" --width=500 --height=150
|
||||
|
||||
;;
|
||||
"${TRANSHELL_CONTENT_ONLY_AVAILABLE_TO_SPARK_DWINE_HELPER_APP}")
|
||||
|
||||
;;
|
||||
|
||||
*)
|
||||
IS_CLOSE="1"
|
||||
;;
|
||||
|
||||
|
||||
esac
|
||||
done
|
||||
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
TRANSHELL_CONTENT_WELCOME_AND_CHOOSE_ONE_TO_RUN="Welcome to spark wine helper settings,Please choose one option below to excute"
|
||||
TRANSHELL_CONTENT_OPTION="Options"
|
||||
TRANSHELL_CONTENT_SET_GLOBAL_SCALE="Set global scale"
|
||||
TRANSHELL_CONTENT_REMOVE_GLOBAL_SCALE="Remove global scale, follow the detected ENV_VAR"
|
||||
TRANSHELL_CONTENT_SET_APP="Single App Settings"
|
||||
TRANSHELL_CONTENT_SYNC_APP_SCALE_WITH_GLOBAL="Sync all the wine app scale with global scale in one key"
|
||||
TRANSHELL_CONTENT_ONLY_AVAILABLE_TO_SPARK_DWINE_HELPER_APP="Note: The options above only take effect on spark-dwine-helper apps"
|
||||
TRANSHELL_CONTENT_YOUR_DIMENSION_IS="Your dimension is :"
|
||||
TRANSHELL_CONTENT_PLEASE_CHOOSE_ONE_BELOW="Please choose one option below"
|
||||
TRANSHELL_CONTENT_1_SCALE_AS_DEFAULT="Setting 1.0 scale as default"
|
||||
TRANSHELL_CONTENT_SCALE_IS="Scale multiple is "
|
||||
TRANSHELL_CONTENT_SAVED="Saved."
|
||||
TRANSHELL_CONTENT_REMOVED="Removed."
|
||||
TRANSHELL_CONTENT_PLEASE_CHOOSE_WINE_BOTTLE_DIRECTORY="Please choose the directory the app you want to adjust in(Please choose DIRECTORY instead of file)"
|
||||
TRANSHELL_CONTENT_ERROR_NO_USER_REG_AS_NOT_A_WINE_BOTTLE="E:user.reg can not be found.This is not a wine bottle"
|
||||
TRANSHELL_CONTENT_SYNC_SCALE_WITH_GLOBAL="Sync with global scale settings"
|
||||
TRANSHELL_CONTENT_WILL_SYNC_SCALE_WITH_GLOBAL="Will sync with global scale settings"
|
||||
TRANSHELL_CONTENT_BOTTLES_BELOW_HAVE_SYNCED_SCALE_WITH_GLOBAL="The scale settings of apps in bottle below is already syncd with global scale settings"
|
||||
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
TRANSHELL_CONTENT_WELCOME_AND_CHOOSE_ONE_TO_RUN="欢迎使用星火wine助手控制中心,请在以下选项中选择一个执行!"
|
||||
TRANSHELL_CONTENT_OPTION="选项"
|
||||
TRANSHELL_CONTENT_SET_GLOBAL_SCALE="设置全局缩放"
|
||||
TRANSHELL_CONTENT_REMOVE_GLOBAL_SCALE="删除全局缩放设置,跟随检测到的环境变量设置"
|
||||
TRANSHELL_CONTENT_SET_APP="设置单个应用"
|
||||
TRANSHELL_CONTENT_SYNC_APP_SCALE_WITH_GLOBAL="一键将所有已安装应用的缩放设置改为与全局缩放一致"
|
||||
TRANSHELL_CONTENT_ONLY_AVAILABLE_TO_SPARK_DWINE_HELPER_APP="备注:以上操作仅对使用了spark-dwine-helper的应用生效"
|
||||
TRANSHELL_CONTENT_YOUR_DIMENSION_IS="您的分辨率是:"
|
||||
TRANSHELL_CONTENT_PLEASE_CHOOSE_ONE_BELOW="请在以下选项中选择一个"
|
||||
TRANSHELL_CONTENT_1_SCALE_AS_DEFAULT="默认为1倍缩放。"
|
||||
TRANSHELL_CONTENT_SCALE_IS="缩放倍数为"
|
||||
TRANSHELL_CONTENT_SAVED="已保存"
|
||||
TRANSHELL_CONTENT_REMOVED="已删除"
|
||||
TRANSHELL_CONTENT_PLEASE_CHOOSE_WINE_BOTTLE_DIRECTORY="请在接下来的文件选择框选中所需的应用所在的容器文件夹(注意要选择文件夹)"
|
||||
TRANSHELL_CONTENT_ERROR_NO_USER_REG_AS_NOT_A_WINE_BOTTLE="错误:找不到user.reg.这不是一个wine容器"
|
||||
TRANSHELL_CONTENT_SYNC_SCALE_WITH_GLOBAL="与全局设置同步"
|
||||
TRANSHELL_CONTENT_WILL_SYNC_SCALE_WITH_GLOBAL="将会与全局设置同步"
|
||||
TRANSHELL_CONTENT_BOTTLES_BELOW_HAVE_SYNCED_SCALE_WITH_GLOBAL="以下容器中的应用的缩放设置已与全局设置同步"
|
||||
@@ -0,0 +1,205 @@
|
||||
#!/bin/bash
|
||||
|
||||
SHELL_DIR=$(dirname $(realpath $0))
|
||||
|
||||
apps_list=()
|
||||
get_apps_list() {
|
||||
|
||||
local app_dirs=($(find /opt/apps -mindepth 1 -maxdepth 1 -type d -exec test -f {}/files/run.sh \; -print))
|
||||
|
||||
if [ ${#app_dirs[@]} -eq 0 ]; then
|
||||
zenity --error --text="请至少在应用商店安装一个wine应用后启动" --width 200
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for app_dir in "${app_dirs[@]}"; do
|
||||
local package_name=$(basename "$app_dir")
|
||||
local run_script="$app_dir/files/run.sh"
|
||||
local bottle_name="无法读取"
|
||||
local version="无法读取"
|
||||
local use_spark="否"
|
||||
|
||||
if [ -f "$run_script" ]; then
|
||||
bottle_name=$(grep -oP 'BOTTLENAME="\K[^"]+' "$run_script")
|
||||
version=$(grep -oP 'APPVER="\K[^"]+' "$run_script")
|
||||
|
||||
if [ -z "$version" ]; then
|
||||
version="无法读取"
|
||||
fi
|
||||
# START_SHELL_PATH=XXX/spark_run_v4.sh
|
||||
if grep spark_run_v4.sh "$run_script" >/dev/null 2>&1 ; then
|
||||
use_spark="是"
|
||||
fi
|
||||
fi
|
||||
|
||||
local app_name=$(get_app_name "$package_name")
|
||||
apps_list+=("$app_name" "$package_name" "$bottle_name" "$version" "$use_spark")
|
||||
done
|
||||
|
||||
|
||||
}
|
||||
|
||||
# 函数:获取应用名称
|
||||
get_app_name() {
|
||||
local app_name_orig=$(grep -m 1 '^Name=' "/usr/share/applications/$1.desktop" | cut -d '=' -f 2)
|
||||
local app_name_i18n=$(grep -m 1 "^Name\[$LANGUAGE\]\=" "/usr/share/applications/$1.desktop" | cut -d '=' -f 2)
|
||||
local app_name=""
|
||||
|
||||
if [ -z "$app_name_i18n" ]; then
|
||||
app_name="$app_name_orig"
|
||||
else
|
||||
app_name="$app_name_i18n"
|
||||
fi
|
||||
|
||||
echo "$app_name"
|
||||
}
|
||||
|
||||
# 函数:选择应用
|
||||
select_app() {
|
||||
get_apps_list
|
||||
for (( i = 0; i < ${#apps_list[@]}; i++ )); do
|
||||
echo ${apps_list[$i]}
|
||||
done
|
||||
|
||||
local app=$(zenity --print-column=2 --width=800 --height=600 --list --title="选择应用" --text="选择要执行的应用" --column="应用名" --column="包名" --column="容器名" --column="版本号" --column="是否使用星火wine助手" "${apps_list[@]}")
|
||||
|
||||
if [ -n "$app" ]; then
|
||||
local app_dir="/opt/apps/$app"
|
||||
local run_script="$app_dir/files/run.sh"
|
||||
local use_spark="否"
|
||||
if grep spark_run_v4.sh "$run_script" >/dev/null 2>&1 ; then
|
||||
use_spark="是"
|
||||
fi
|
||||
if [ "$use_spark" == "是" ]; then
|
||||
select_spark_action "$app" "$(get_app_name $app)"
|
||||
else
|
||||
select_non_spark_action "$app" "$(get_app_name $app)"
|
||||
fi
|
||||
fi
|
||||
### 还原分隔符
|
||||
IFS="$IFS_OLD"
|
||||
}
|
||||
|
||||
select_non_spark_action(){
|
||||
local app="$1"
|
||||
local app_name="$2"
|
||||
local options=("在终端中打开" "打开容器目录" "清理并重置容器目录" "更多操作")
|
||||
local choice=$(zenity --width=800 --height=600 --list --title="选择操作" --text="选择要对$app_name执行的操作" --column="操作" "${options[@]}")
|
||||
case "$choice" in
|
||||
"在终端中打开")
|
||||
local app_dir="/opt/apps/$app"
|
||||
local run_script="$app_dir/files/run.sh"
|
||||
x-terminal-emulator -e "$run_script"
|
||||
;;
|
||||
"打开容器目录")
|
||||
local app_dir="/opt/apps/$app"
|
||||
local run_script="$app_dir/files/run.sh"
|
||||
local bottle_name=$(grep -oP 'BOTTLENAME="\K[^"]+' "$run_script")
|
||||
xdg-open file:///home/$(whoami)/.deepinwine/${bottle_name}
|
||||
;;
|
||||
"清理并重置容器目录")
|
||||
local app_dir="/opt/apps/$app"
|
||||
local run_script="$app_dir/files/run.sh"
|
||||
local bottle_name=$(grep -oP 'BOTTLENAME="\K[^"]+' "$run_script")
|
||||
$SHELL_DIR/../kill.sh ${bottle_name}
|
||||
rm -rf /home/$(whoami)/.deepinwine/${bottle_name}/*
|
||||
zenity --info --width=300 --text="操作已完成,请重启Wine应用查看"
|
||||
;;
|
||||
"更多操作")
|
||||
if [ -e /usr/bin/deepin-wine-runner ];then
|
||||
/usr/bin/deepin-wine-runner
|
||||
elif [ $(command -v spark-store) ];then
|
||||
spark-store spk://store/tools/spark-deepin-wine-runner
|
||||
elif [ $(command -v deepin-home-appstore-client) ];then
|
||||
xdg-open appstore://deepin-home-appstore-client?app_detail_info/spark-deepin-wine-runner
|
||||
else
|
||||
xdg-open https://gitee.com/gfdgd-xi/deep-wine-runner/releases
|
||||
fi
|
||||
|
||||
;;
|
||||
esac
|
||||
|
||||
}
|
||||
|
||||
# 函数:选择星火wine助手操作
|
||||
select_spark_action() {
|
||||
local app="$1"
|
||||
local app_name="$2"
|
||||
local options=("在终端中打开" "打开容器目录" "清理并重置容器目录" "修改应用缩放" "更多操作")
|
||||
local choice=$(zenity --width=800 --height=600 --list --title="选择操作" --text="选择要对$app_name执行的操作" --column="操作" "${options[@]}")
|
||||
|
||||
case "$choice" in
|
||||
"在终端中打开")
|
||||
local app_dir="/opt/apps/$app"
|
||||
local run_script="$app_dir/files/run.sh"
|
||||
x-terminal-emulator -e "$run_script"
|
||||
;;
|
||||
"打开容器目录")
|
||||
local app_dir="/opt/apps/$app"
|
||||
local run_script="$app_dir/files/run.sh"
|
||||
local bottle_name=$(grep -oP 'BOTTLENAME="\K[^"]+' "$run_script")
|
||||
xdg-open file:///home/$(whoami)/.deepinwine/${bottle_name}
|
||||
;;
|
||||
"清理并重置容器目录")
|
||||
local app_dir="/opt/apps/$app"
|
||||
local run_script="$app_dir/files/run.sh"
|
||||
local bottle_name=$(grep -oP 'BOTTLENAME="\K[^"]+' "$run_script")
|
||||
$SHELL_DIR/../spark_kill.sh ${bottle_name}
|
||||
rm -rf /home/$(whoami)/.deepinwine/${bottle_name}/*
|
||||
zenity --info --width=300 --text="操作已完成,请重启Wine应用查看"
|
||||
;;
|
||||
"修改应用缩放")
|
||||
select_scale_action "应用" "$app"
|
||||
;;
|
||||
# "修改全局缩放")
|
||||
# select_scale_action "全局" "$app"
|
||||
# ;;
|
||||
"更多操作")
|
||||
if [ -e /usr/bin/deepin-wine-runner ];then
|
||||
/usr/bin/deepin-wine-runner
|
||||
elif [ $(command -v spark-store) ];then
|
||||
spark-store spk://store/tools/spark-deepin-wine-runner
|
||||
elif [ $(command -v deepin-home-appstore-client) ];then
|
||||
xdg-open appstore://deepin-home-appstore-client?app_detail_info/spark-deepin-wine-runner
|
||||
else
|
||||
xdg-open https://gitee.com/gfdgd-xi/deep-wine-runner/releases
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# 函数:选择缩放操作
|
||||
select_scale_action() {
|
||||
local scale_type="$1"
|
||||
local app="$2"
|
||||
local app_dir="/opt/apps/$app"
|
||||
local run_script="$app_dir/files/run.sh"
|
||||
local bottle_name=$(grep -oP 'BOTTLENAME="\K[^"]+' "$run_script")
|
||||
local scale_factors=("1.0" "1.25" "1.5" "1.75" "2.0" "2.5" "3.0" "3.5" "4.0" "恢复默认")
|
||||
local choice=$(zenity --width=800 --height=600 --list --title="选择缩放比例" --text="选择要设置的缩放比例" --column="比例" "${scale_factors[@]}")
|
||||
|
||||
if [ -n "$choice" ]; then
|
||||
local scale_factor="$choice"
|
||||
|
||||
if [ "$scale_type" == "应用" ]; then
|
||||
if [ "$scale_factor" == "恢复默认" ];then
|
||||
rm $HOME/.deepinwine/$bottle_name/scale.txt
|
||||
else
|
||||
echo "$scale_factor" > "$HOME/.deepinwine/$bottle_name/scale.txt"
|
||||
fi
|
||||
elif [ "$scale_type" == "全局" ]; then
|
||||
if [ "$scale_factor" == "恢复默认" ];then
|
||||
rm $HOME/.config/spark-wine/scale.txt
|
||||
else
|
||||
echo "$scale_factor" > "$HOME/.config/spark-wine/scale.txt"
|
||||
find "$HOME/.deepinwine/" -name "scale.txt" -type f -print -exec rm -rf {} \;
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
zenity --info --width=300 --text="操作已完成,请重启Wine应用查看"
|
||||
}
|
||||
|
||||
select_app
|
||||
|
||||
57
spark-dwine-helper/s-wine-helper/opt/spark-dwine-helper/spark-wine-banner
Executable file
57
spark-dwine-helper/s-wine-helper/opt/spark-dwine-helper/spark-wine-banner
Executable file
@@ -0,0 +1,57 @@
|
||||
#!/bin/bash
|
||||
|
||||
##### 若有pybanner则尝试启动
|
||||
#if [ -e ${SHELL_DIR}/spark-dwine-helper/pybanner/pybanner.py ];then
|
||||
#echo "Protocol upgrade: Trying to activate python banner..."
|
||||
#python3 ${SHELL_DIR}/spark-dwine-helper/pybanner/pybanner.py
|
||||
#if [ "$?" = "0" ];then
|
||||
#exit
|
||||
#else
|
||||
#echo "Failed to activate. Fallback to normal zenity."
|
||||
#fi
|
||||
#fi
|
||||
|
||||
|
||||
if [ ! -z "$WAYLAND_DISPLAY" ]; then
|
||||
echo "Wayland detected. Do not check wmclass"
|
||||
zenity --progress --title="星火Windows应用兼容助手" --text="正在为您启动以下应用:$WINE_APP_NAME" --pulsate --width=400 --auto-close --no-cancel --timeout=3
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ -z "$(which wmctrl)" ]; then
|
||||
echo "No wmctrl installed. Do not check wmclass"
|
||||
zenity --progress --title="星火Windows应用兼容助手" --text="正在为您启动以下应用:$WINE_APP_NAME" --pulsate --width=400 --auto-close --no-cancel --timeout=3
|
||||
exit
|
||||
fi
|
||||
|
||||
target_wmclass="$WINE_WMCLASS"
|
||||
|
||||
|
||||
function check_window() {
|
||||
# 使用 wmctrl 命令列出所有窗口,并使用 grep 过滤出特定的 WMCLASS
|
||||
windows=$(wmctrl -lx | grep "$target_wmclass")
|
||||
|
||||
# 如果窗口存在,则关闭提示
|
||||
if [ -n "$windows" ]; then
|
||||
# 提取窗口ID
|
||||
window_id=$(echo "$windows" | awk '{print $1}')
|
||||
|
||||
echo "Window with WMCLASS '$target_wmclass' found"
|
||||
exit
|
||||
else
|
||||
echo "Window with WMCLASS '$target_wmclass' not found."
|
||||
fi
|
||||
}
|
||||
|
||||
function check_wmclass(){
|
||||
# 递归检测窗口是否存在的函数
|
||||
|
||||
# 每隔一段时间检测一次窗口是否存在
|
||||
while true; do
|
||||
check_window
|
||||
# 等待一段时间后再次检测
|
||||
sleep 1
|
||||
done
|
||||
}
|
||||
|
||||
check_wmclass | zenity --progress --title="星火Windows应用兼容助手" --text="正在为您启动以下应用:$WINE_APP_NAME" --pulsate --width=400 --auto-close --no-cancel --timeout=3
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python3
|
||||
# vim: set ts=4 sw=4 fileencoding=utf-8:
|
||||
# Luomio <nohappiness@gmail.com>
|
||||
# Filename: dde-first-run.py
|
||||
# Create Date: 27-03, 13
|
||||
|
||||
import dbus
|
||||
|
||||
def get_tray_window():
|
||||
bus = dbus.SessionBus()
|
||||
traymanager = bus.get_object("com.deepin.dde.TrayManager", "/com/deepin/dde/TrayManager")
|
||||
|
||||
traymanager_iface = dbus.Interface(traymanager, dbus_interface='org.freedesktop.DBus.Properties')
|
||||
windows = traymanager_iface.Get("com.deepin.dde.TrayManager","TrayIcons")
|
||||
str="window_id:"
|
||||
for i in range(len(windows)):
|
||||
str += '{:#x} '.format(windows[i])
|
||||
|
||||
print(str)
|
||||
|
||||
if __name__ == "__main__":
|
||||
get_tray_window()
|
||||
Binary file not shown.
BIN
spark-dwine-helper/s-wine-helper/opt/spark-dwine-helper/spark_gl-wine/gl-wine32
Executable file
BIN
spark-dwine-helper/s-wine-helper/opt/spark-dwine-helper/spark_gl-wine/gl-wine32
Executable file
Binary file not shown.
BIN
spark-dwine-helper/s-wine-helper/opt/spark-dwine-helper/spark_gl-wine/gl-wine64
Executable file
BIN
spark-dwine-helper/s-wine-helper/opt/spark-dwine-helper/spark_gl-wine/gl-wine64
Executable file
Binary file not shown.
@@ -0,0 +1,19 @@
|
||||
#/bin/bash
|
||||
|
||||
cd $(dirname $0)
|
||||
|
||||
SHELL_DIR=$(dirname $(realpath $0))
|
||||
runtime_path=/opt/deepinwine/runtime-i386
|
||||
echo $runtime_path
|
||||
if [ -f "$runtime_path/init_runtime.sh" ];then
|
||||
source "$runtime_path/init_runtime.sh"
|
||||
|
||||
init_runtime
|
||||
init_32bit_config
|
||||
echo "use deepinwine runtime"
|
||||
"$WINELDPATH" ./gl-wine32
|
||||
exit $?
|
||||
fi
|
||||
|
||||
./gl-wine32
|
||||
exit $?
|
||||
272
spark-dwine-helper/s-wine-helper/opt/spark-dwine-helper/spark_kill.sh
Executable file
272
spark-dwine-helper/s-wine-helper/opt/spark-dwine-helper/spark_kill.sh
Executable file
@@ -0,0 +1,272 @@
|
||||
#!/bin/bash
|
||||
#####因为arm版本的deepin-wine-helper不带这个,又不想破坏x86兼容性,故改名
|
||||
APP_NAME="QQ"
|
||||
LOG_FILE=$0
|
||||
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
|
||||
494
spark-dwine-helper/s-wine-helper/opt/spark-dwine-helper/spark_run_v4.sh
Executable file
494
spark-dwine-helper/s-wine-helper/opt/spark-dwine-helper/spark_run_v4.sh
Executable file
@@ -0,0 +1,494 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2016 Deepin, Inc.
|
||||
# Copyright (C) 2022 The Spark Project
|
||||
#
|
||||
# Author: Li LongYu <lilongyu@linuxdeepin.com>
|
||||
# Peng Hao <penghao@linuxdeepin.com>
|
||||
#
|
||||
# Modifier: shenmo <shenmo@spark-app.store>
|
||||
#
|
||||
#
|
||||
SHELL_DIR=$(dirname $(realpath $0))
|
||||
|
||||
export SHELL_DIR
|
||||
source ${SHELL_DIR}/bashimport/log-function.bashimport
|
||||
source ${SHELL_DIR}/bashimport/transhell.bashimport
|
||||
load_transhell_debug
|
||||
|
||||
#########Preload functions
|
||||
function get_app_name() {
|
||||
local app_name_orig=$(grep -m 1 '^Name=' "/usr/share/applications/$1.desktop" | cut -d '=' -f 2)
|
||||
local app_name_i18n=$(grep -m 1 "^Name\[$LANGUAGE\]\=" "/usr/share/applications/$1.desktop" | cut -d '=' -f 2)
|
||||
local app_name=""
|
||||
|
||||
if [ -z "$app_name_i18n" ]; then
|
||||
app_name="$app_name_orig"
|
||||
elif [ -z "$app_name_orig" ]; then
|
||||
app_name="自定义应用"
|
||||
else
|
||||
app_name="$app_name_i18n"
|
||||
fi
|
||||
|
||||
echo "$app_name"
|
||||
}
|
||||
######### Vars
|
||||
BOTTLENAME=""
|
||||
BOTTLENAME="$1"
|
||||
WINEPREFIX="$HOME/.deepinwine/$1"
|
||||
APPDIR="/opt/apps/${DEB_PACKAGE_NAME}/files"
|
||||
APPVER=""
|
||||
APPTAR="files.7z"
|
||||
WINE_CMD="deepin-wine"
|
||||
#这里会被后续覆盖
|
||||
LOG_FILE=$0
|
||||
PUBLIC_DIR="/var/public"
|
||||
if [ -z $WINE_WMCLASS ];then
|
||||
export WINE_WMCLASS="$DEB_PACKAGE_NAME"
|
||||
fi
|
||||
export WINE_APP_NAME=$(get_app_name ${DEB_PACKAGE_NAME})
|
||||
if [ -z "$WINE_APP_NAME" ];then
|
||||
export WINE_APP_NAME=$BOTTLENAME
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
if [ -e /opt/p7zip-legacy/bin/7z ];then
|
||||
log.debug "Using p7zip-legacy as unpacker"
|
||||
UNPACK_CMD=/opt/p7zip-legacy/bin/7z
|
||||
else
|
||||
UNPACK_CMD=7z
|
||||
log.debug "Using system 7z as unpacker"
|
||||
fi
|
||||
|
||||
|
||||
if [ $APPRUN_CMD ]; then
|
||||
WINE_CMD=$APPRUN_CMD
|
||||
fi
|
||||
|
||||
|
||||
##################### Functions
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
_DeleteRegistry()
|
||||
{
|
||||
env WINEPREFIX="$WINEPREFIX" $WINE_CMD reg DELETE "$1" /f &> /dev/null
|
||||
}
|
||||
#########功能:删除注册表
|
||||
init_log_file()
|
||||
{
|
||||
if [ ! -d "$DEBUG_LOG" ];then
|
||||
return
|
||||
fi
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
debug_log_to_file()
|
||||
{
|
||||
if [ -d "$DEBUG_LOG" ];then
|
||||
echo -e "${1}" >> "$LOG_FILE"
|
||||
fi
|
||||
}
|
||||
|
||||
debug_log()
|
||||
{
|
||||
log.debug "${1}"
|
||||
}
|
||||
################log相关功能
|
||||
HelpApp()
|
||||
{
|
||||
echo " Extra Commands:"
|
||||
echo " -r/--reset Reset app to fix errors"
|
||||
echo " -e/--remove Remove deployed app files"
|
||||
echo " -h/--help Show program help info"
|
||||
}
|
||||
#############帮助文件
|
||||
|
||||
check_link()
|
||||
{
|
||||
if [ ! -d "$1" ];then
|
||||
echo "$1 不是目录,不能创建$2软连接"
|
||||
return
|
||||
fi
|
||||
link_path=$(realpath "$2")
|
||||
target_path=$(realpath "$1")
|
||||
if [ "$link_path" != "$target_path" ];then
|
||||
if [ -d "$2" ];then
|
||||
mv "$2" "${2}.bak"
|
||||
else
|
||||
rm "$2"
|
||||
fi
|
||||
echo "修复$2软连接为$1"
|
||||
ln -s -f "$1" "$2"
|
||||
fi
|
||||
}
|
||||
|
||||
FixLink()
|
||||
{
|
||||
if [ -d ${WINEPREFIX} ]; then
|
||||
CUR_DIR=$PWD
|
||||
cd "${WINEPREFIX}/dosdevices"
|
||||
check_link ../drive_c c:
|
||||
check_link / z:
|
||||
check_link $HOME y:
|
||||
cd "../drive_c/users/$USER"
|
||||
check_link "$HOME/Desktop" Desktop
|
||||
check_link "$HOME/Downloads" Downloads
|
||||
# Link to Document
|
||||
if [ -L "$WINEPREFIX/drive_c/users/$(whoami)/My Documents" ]; then
|
||||
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%\My Documents" /f
|
||||
|
||||
else
|
||||
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
|
||||
|
||||
fi
|
||||
cd $CUR_DIR
|
||||
#ls -l "${WINEPREFIX}/dosdevices"
|
||||
fi
|
||||
}
|
||||
###########会在应用启动和解压时执行,驱动器绑定
|
||||
DisableWrite()
|
||||
{
|
||||
if [ -d "${1}" ]; then
|
||||
chmod +w "${1}"
|
||||
rm -rf "${1}"
|
||||
fi
|
||||
|
||||
mkdir "${1}"
|
||||
chmod -w "${1}"
|
||||
}
|
||||
########如果有该文件夹则删除,然后再创建一个不允许写入的
|
||||
is_autostart()
|
||||
{
|
||||
AUTOSTART="/opt/deepinwine/tools/autostart"
|
||||
if [[ -f "$SHELL_DIR/autostart" ]]; then
|
||||
# 如果打包时自带 autostart,则使用自带的
|
||||
AUTOSTART="$SHELL_DIR/autostart"
|
||||
fi
|
||||
if [ -f "$AUTOSTART.all" ]&&[ -f "/opt/apps/$1/files/run.sh" ];then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ -f $AUTOSTART ];then
|
||||
grep -c "$1" $AUTOSTART > /dev/null
|
||||
return $?
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
#########自动启动相关,等用到了再研究
|
||||
|
||||
Test_GL_wine()
|
||||
{
|
||||
gl_wine_path="${SHELL_DIR}/spark_gl-wine"
|
||||
|
||||
#如果不支持32的GLX,d3d改为gdi的实现
|
||||
if [[ ! -f "${WINEPREFIX}/.init_d3d" ]];then
|
||||
if [[ $WINE_CMD == *"deepin-wine8-stable"* ]];then
|
||||
gl_wine="${gl_wine_path}/gl-wine64"
|
||||
else
|
||||
gl_wine="${gl_wine_path}/run_gl.sh"
|
||||
fi
|
||||
|
||||
run_gl=`${gl_wine} 2>&1`
|
||||
|
||||
#如果opengl测试程序运行失败,所有进程的渲染方式改为gdi渲染模式
|
||||
if [ $? != 0 ];then
|
||||
WINEPREFIX="$WINEPREFIX" $WINE_CMD regedit /S "${gl_wine_path}/gdid3d.reg"
|
||||
fi
|
||||
|
||||
touch "${WINEPREFIX}/.init_d3d"
|
||||
fi
|
||||
}
|
||||
urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
|
||||
#######url转义
|
||||
|
||||
#arg 1: windows process file path
|
||||
#arg 2-*: windows process args
|
||||
CallProcess()
|
||||
{
|
||||
#get file full path
|
||||
path="$1"
|
||||
path=$(echo ${path/c:/${WINEPREFIX}/drive_c})
|
||||
path=$(echo ${path//\\/\/})
|
||||
|
||||
#kill bloack process
|
||||
is_autostart $DEB_PACKAGE_NAME
|
||||
autostart=$?
|
||||
if [[ $autostart -ne 0 ]] && [[ "$1" != *"pluginloader.exe" ]];then
|
||||
$SHELL_DIR/spark_kill.sh "$BOTTLENAME" block
|
||||
fi
|
||||
#run gl-wine for test opengl
|
||||
get_arch=`uname -m`
|
||||
if [[ $get_arch = "x86_64" ]];then
|
||||
Test_GL_wine
|
||||
fi
|
||||
#change current dir to excute path
|
||||
path=$(dirname "$path")
|
||||
cd "$path"
|
||||
pwd
|
||||
|
||||
#Set default mime type
|
||||
if [ -n "$MIME_TYPE" ]; then
|
||||
xdg-mime default "$DEB_PACKAGE_NAME".desktop "$MIME_TYPE"
|
||||
fi
|
||||
# Disable winemenubuilder
|
||||
env WINEPREFIX="$WINEPREFIX" $WINE_CMD reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v winemenubuilder.exe /f
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
debug_log "Starting process $* ..."
|
||||
|
||||
############# WARNING: Here is the modified content: Now will run set-dwine-scale.sh
|
||||
${SHELL_DIR}/spark-dwine-helper/scale-set-helper/set-wine-scale.sh "$WINEPREFIX"
|
||||
#$SHELL_DIR/spark-wine-banner &
|
||||
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$@"
|
||||
|
||||
#start autobottle
|
||||
if [ $autostart -eq 0 ];then
|
||||
$SHELL_DIR/autostart_wine.sh $DEB_PACKAGE_NAME
|
||||
fi
|
||||
}
|
||||
###通用启动APP逻辑。对于没有被case捕捉的非适配APP,则直接执行此部分。似乎已经有了防止残留的功能
|
||||
###一些自定义的应用不会使用这个启动,而另一些则会调用这个
|
||||
###有设置mimetype和自动启动(这个暂时没分析)的功能
|
||||
|
||||
###########专属优化段:
|
||||
|
||||
|
||||
UnixUriToDosPath()
|
||||
{
|
||||
OPEN_FILE="$1"
|
||||
if [ -f "$OPEN_FILE" ]; then
|
||||
OPEN_FILE=$(realpath "$OPEN_FILE")
|
||||
OPEN_FILE="z:$OPEN_FILE"
|
||||
OPEN_FILE=$(echo $OPEN_FILE | sed -e 's/\//\\\\/g')
|
||||
fi
|
||||
echo $OPEN_FILE
|
||||
}
|
||||
|
||||
#arg 1: exec file path
|
||||
#arg 2: autostart ,or exec arg 1
|
||||
#arg 3: exec arg 2
|
||||
|
||||
#### CallApp段,根据容器名找专属优化,没有就走通用启动
|
||||
CallApp()
|
||||
{
|
||||
|
||||
|
||||
|
||||
FixLink
|
||||
debug_log "CallApp $BOTTLENAME arg count $#: $*"
|
||||
if [ -f "/opt/apps/${DEB_PACKAGE_NAME}/files/pre_run.sh" ];then
|
||||
source "/opt/apps/${DEB_PACKAGE_NAME}/files/pre_run.sh"
|
||||
CallPreRun "$@"
|
||||
fi
|
||||
if [ -e "/opt/deepinwine/tools/spark_run_v4_app_configs/${BOTTLENAME}.sh" ];then
|
||||
APP_CONFIG_PATH="/opt/deepinwine/tools/spark_run_v4_app_configs/${BOTTLENAME}.sh"
|
||||
else
|
||||
APP_CONFIG_PATH="${SHELL_DIR}/spark_run_v4_app_configs/${BOTTLENAME}.sh"
|
||||
fi
|
||||
if [ -f "$APP_CONFIG_PATH" ]; then
|
||||
echo "执行 ${BOTTLENAME}.sh ..."
|
||||
source $APP_CONFIG_PATH
|
||||
else
|
||||
echo "$APP_CONFIG_PATH 文件不存在,执行通用启动"
|
||||
CallProcess "$@"
|
||||
fi
|
||||
|
||||
|
||||
}
|
||||
ExtractApp()
|
||||
{
|
||||
|
||||
|
||||
local tmp_log=$(mktemp)
|
||||
mkdir -p "$1"
|
||||
(${UNPACK_CMD} x "$APPDIR/$APPTAR" -o"$1" -bsp1 -bb1 -bse2 | grep --line-buffered -oP "(\d+(\.\d+)?(?=%))" > $tmp_log)&
|
||||
|
||||
cmd_pid=$!
|
||||
(while kill -0 $cmd_pid 2> /dev/null; do
|
||||
tail -n 1 "${tmp_log}"
|
||||
sleep 1
|
||||
done)| zenity --progress --title="${TRANSHELL_CONTENT_SPARK_WINDOWS_COMPATIBILITY_TOOL}" --text="${TRANSHELL_CONTENT_UNPACKING} $WINE_APP_NAME..." --width=600 --auto-close --no-cancel
|
||||
rm $tmp_log
|
||||
|
||||
|
||||
mv "$1/drive_c/users/@current_user@" "$1/drive_c/users/$USER"
|
||||
sed -i "s#@current_user@#$USER#" $1/*.reg
|
||||
FixLink
|
||||
}
|
||||
DeployApp()
|
||||
{
|
||||
ExtractApp "$WINEPREFIX"
|
||||
|
||||
|
||||
echo "$APPVER" > "$WINEPREFIX/PACKAGE_VERSION"
|
||||
|
||||
}
|
||||
RemoveApp()
|
||||
{
|
||||
rm -rf "$WINEPREFIX"
|
||||
}
|
||||
ResetApp()
|
||||
{
|
||||
debug_log "Reset $PACKAGENAME....."
|
||||
read -p "* Are you sure?(Y/N)" ANSWER
|
||||
if [ "$ANSWER" = "Y" -o "$ANSWER" = "y" -o -z "$ANSWER" ]; then
|
||||
EvacuateApp
|
||||
DeployApp
|
||||
CallApp
|
||||
fi
|
||||
}
|
||||
UpdateApp()
|
||||
{
|
||||
if [ -d "${WINEPREFIX}.tmpdir" ]; then
|
||||
rm -rf "${WINEPREFIX}.tmpdir"
|
||||
fi
|
||||
if [ -f "$WINEPREFIX/PACKAGE_VERSION" ] && [ "$(cat "$WINEPREFIX/PACKAGE_VERSION")" = "$APPVER" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
if [ -f "/opt/apps/${DEB_PACKAGE_NAME}/files/pre_update.sh" ];then
|
||||
source "/opt/apps/${DEB_PACKAGE_NAME}/files/pre_update.sh"
|
||||
CallPreUpdate
|
||||
return
|
||||
fi
|
||||
|
||||
|
||||
case $BOTTLENAME in
|
||||
"Deepin-Intelligent" | "Deepin-QQ" | "Deepin-TIM" | "Deepin-WeChat" | "Deepin-WXWork" | "Deepin-Dding" | "Wine-QQ" | "Spark-QQ" | "Spark-weixin")
|
||||
rm -rf "$WINEPREFIX"
|
||||
DeployApp
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
ExtractApp "${WINEPREFIX}.tmpdir"
|
||||
$SHELL_DIR/spark_updater -s "${WINEPREFIX}.tmpdir" -c "${WINEPREFIX}" -v
|
||||
|
||||
|
||||
rm -rf "${WINEPREFIX}.tmpdir"
|
||||
echo "$APPVER" > "$WINEPREFIX/PACKAGE_VERSION"
|
||||
}
|
||||
RunApp()
|
||||
{
|
||||
|
||||
|
||||
progpid=$(ps -ef | grep "zenity --progress --title=${BOTTLENAME}" | grep -v grep)
|
||||
debug_log "run ${BOTTLENAME} progress pid $progpid"
|
||||
if [ -n "$progpid" ]; then
|
||||
debug_log "$BOTTLENAME is running"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -d "$WINEPREFIX" ]; then
|
||||
if [ ! -f "$WINEPREFIX/PACKAGE_VERSION" ] || [ "$(cat "$WINEPREFIX/PACKAGE_VERSION")" != "$APPVER" ]; then
|
||||
UpdateApp
|
||||
fi
|
||||
else
|
||||
DeployApp
|
||||
fi
|
||||
|
||||
CallApp "$@"
|
||||
}
|
||||
|
||||
CreateBottle()
|
||||
{
|
||||
if [ -d "$WINEPREFIX" ]; then
|
||||
if [ ! -f "$WINEPREFIX/PACKAGE_VERSION" ] || [ "$(cat "$WINEPREFIX/PACKAGE_VERSION")" != "$APPVER" ]; then
|
||||
UpdateApp
|
||||
fi
|
||||
else
|
||||
DeployApp
|
||||
fi
|
||||
}
|
||||
|
||||
ParseArgs()
|
||||
{
|
||||
if [ $# -eq 4 ];then
|
||||
RunApp "$3"
|
||||
elif [ -f "$5" ];then
|
||||
if [ -n "$MIME_EXEC" ];then
|
||||
RunApp "$MIME_EXEC" "$(UnixUriToDosPath "$5")" "${@:6}"
|
||||
else
|
||||
RunApp "$3" "$(UnixUriToDosPath "$5")" "${@:6}"
|
||||
fi
|
||||
else
|
||||
RunApp "$3" "${@:5}"
|
||||
fi
|
||||
}
|
||||
|
||||
#init_log_file
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#####准备启动进程,分析在 https://blog.shenmo.tech/post/deepin-wine6%E7%9A%84run_v4%E8%84%9A%E6%9C%AC%E6%8E%A2%E7%B4%A2%E5%90%AF%E5%8A%A8%E6%96%B9%E5%BC%8F/
|
||||
if [ $# -lt 3 ]; then
|
||||
debug_log "参数个数小于3个"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
APPDIR="/opt/apps/${DEB_PACKAGE_NAME}/files"
|
||||
if [ -f "$APPDIR/files.md5sum" ];then
|
||||
APPVER="$(cat $APPDIR/files.md5sum)"
|
||||
else
|
||||
APPVER="$2"
|
||||
fi
|
||||
|
||||
debug_log "Run $*"
|
||||
|
||||
|
||||
#执行lnk文件通过判断第5个参数是否是“/Unix”来判断
|
||||
if [ "$4" == "/Unix" ];then
|
||||
RunApp "$3" "$4" "$5"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ $# -lt 4 ]; then
|
||||
RunApp "$3"
|
||||
exit 0
|
||||
fi
|
||||
case $4 in
|
||||
"-r" | "--reset")
|
||||
ResetApp
|
||||
;;
|
||||
"-cb" | "--create")
|
||||
CreateBottle
|
||||
;;
|
||||
"-e" | "--remove")
|
||||
RemoveApp
|
||||
;;
|
||||
"-u" | "--uri")
|
||||
ParseArgs "$@"
|
||||
;;
|
||||
"-f" | "--file")
|
||||
ParseArgs "$@"
|
||||
;;
|
||||
"-h" | "--help")
|
||||
HelpApp
|
||||
;;
|
||||
*)
|
||||
echo "Invalid option: $4"
|
||||
echo "Use -h|--help to get help"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
exit 0
|
||||
@@ -0,0 +1,22 @@
|
||||
#get file full path
|
||||
path="$1"
|
||||
path=$(echo ${path/c:/${WINEPREFIX}/drive_c})
|
||||
path=$(echo ${path//\\/\/})
|
||||
|
||||
#kill bloack process
|
||||
name="${path##*/}"
|
||||
$SHELL_DIR/spark_kill.sh "$name" block
|
||||
|
||||
#change current dir to excute path
|
||||
path=$(dirname "$path")
|
||||
cd "$path"
|
||||
pwd
|
||||
|
||||
#Set default mime type
|
||||
if [ -n "$MIME_TYPE" ]; then
|
||||
xdg-mime default "$DEB_PACKAGE_NAME".desktop "$MIME_TYPE"
|
||||
fi
|
||||
|
||||
debug_log_to_file "Starting process $* ..."
|
||||
|
||||
CallProcess "$@"
|
||||
@@ -0,0 +1,4 @@
|
||||
debug_log "run $1"
|
||||
$SHELL_DIR/spark_kill.sh DingTalk block
|
||||
|
||||
CallProcess "$@"
|
||||
@@ -0,0 +1,9 @@
|
||||
#set -- "$1" "${2#file://*}"
|
||||
local path=$(urldecode "$2")
|
||||
path=${path/file:\/\//}
|
||||
set -- "$1" "$path"
|
||||
if [ "$path" ];then
|
||||
CallProcess "$@"
|
||||
else
|
||||
CallProcess "$1"
|
||||
fi
|
||||
@@ -0,0 +1,9 @@
|
||||
#set -- "$1" "${2#file://*}"
|
||||
local path=$(urldecode "$2")
|
||||
path=${path/file:\/\//}
|
||||
set -- "$1" "$path"
|
||||
if [ "$path" ];then
|
||||
CallProcess "$@"
|
||||
else
|
||||
CallProcess "$1"
|
||||
fi
|
||||
@@ -0,0 +1,2 @@
|
||||
sed -i '/LogPixels/d' ${WINEPREFIX}/user.reg
|
||||
CallProcess "$@"
|
||||
@@ -0,0 +1,9 @@
|
||||
#set -- "$1" "${2#file://*}"
|
||||
local path=$(urldecode "$2")
|
||||
path=${path/file:\/\//}
|
||||
set -- "$1" "$path"
|
||||
if [ "$path" ];then
|
||||
CallProcess "$@"
|
||||
else
|
||||
CallProcess "$1"
|
||||
fi
|
||||
@@ -0,0 +1 @@
|
||||
Deepin-QQ.sh
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
if [ ! -f "$WINEPREFIX/../.QQ_run" ]; then
|
||||
debug_log "first run time"
|
||||
$SHELL_DIR/add_hotkeys
|
||||
$SHELL_DIR/fontconfig
|
||||
touch "$WINEPREFIX/../.QQ_run"
|
||||
fi
|
||||
|
||||
DisableWrite "${WINEPREFIX}/drive_c/Program Files/Tencent/QQ/Bin/QQLiveMPlayer"
|
||||
DisableWrite "${WINEPREFIX}/drive_c/Program Files/Tencent/QQ/Bin/QQLiveMPlayer1"
|
||||
DisableWrite "${WINEPREFIX}/drive_c/Program Files/Tencent/QzoneMusic"
|
||||
|
||||
DisableWrite "${WINEPREFIX}/drive_c/Program Files/Tencent/QQBrowser"
|
||||
DisableWrite "${WINEPREFIX}/drive_c/Program Files/Common Files/Tencent/QQBrowser"
|
||||
DisableWrite "${WINEPREFIX}/drive_c/users/Public/Application Data/Tencent/QQBrowserBin"
|
||||
DisableWrite "${WINEPREFIX}/drive_c/users/Public/Application Data/Tencent/QQBrowserDefault"
|
||||
DisableWrite "${WINEPREFIX}/drive_c/users/${USER}/Application Data/Tencent/QQBrowserDefault"
|
||||
|
||||
DisableWrite "${WINEPREFIX}/drive_c/users/Public/Application Data/Tencent/QQPCMgr"
|
||||
DisableWrite "${WINEPREFIX}/drive_c/Program Files/Common Files/Tencent/QQPCMgr"
|
||||
|
||||
DisableWrite "${WINEPREFIX}/drive_c/Program Files/Common Files/Tencent/HuaYang"
|
||||
DisableWrite "${WINEPREFIX}/drive_c/users/${USER}/Application Data/Tencent/HuaYang"
|
||||
|
||||
CallProcess "$@"
|
||||
@@ -0,0 +1,3 @@
|
||||
debug_log "run $1"
|
||||
$SHELL_DIR/spark_kill.sh QQMicroGameBox block
|
||||
CallProcess "$1" -action:force_download -appid:1104632801 -pid:8 -bin_version:1.1.2.4 -loginuin:
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
debug_log "run $1"
|
||||
$SHELL_DIR/spark_kill.sh qqgame block
|
||||
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$1" &
|
||||
@@ -0,0 +1,3 @@
|
||||
debug_log "run $1"
|
||||
$SHELL_DIR/spark_kill.sh QQMicroGameBox block
|
||||
CallProcess "$1" -action:force_download -appid:363 -pid:8 -bin_version:1.1.2.4 -loginuin:
|
||||
@@ -0,0 +1,3 @@
|
||||
debug_log "run $1"
|
||||
$SHELL_DIR/spark_kill.sh QQMicroGameBox block
|
||||
CallProcess "$1" -action:force_download -appid:1105856612 -pid:8 -bin_version:1.1.2.4 -loginuin:
|
||||
@@ -0,0 +1,3 @@
|
||||
debug_log "run $1"
|
||||
$SHELL_DIR/spark_kill.sh QQMicroGameBox block
|
||||
CallProcess "$1" -action:force_download -appid:1105640244 -pid:8 -bin_version:1.1.2.4 -loginuin:
|
||||
@@ -0,0 +1,23 @@
|
||||
$SHELL_DIR/spark_kill.sh ths block
|
||||
|
||||
debug_log "Start run $1"
|
||||
#get file full path
|
||||
path="$1"
|
||||
path=$(echo ${path/c:/${WINEPREFIX}/drive_c})
|
||||
path=$(echo ${path//\\/\/})
|
||||
|
||||
#kill bloack process
|
||||
name="${path##*/}"
|
||||
$SHELL_DIR/spark_kill.sh "$name" block
|
||||
|
||||
#change current dir to excute path
|
||||
path=$(dirname "$path")
|
||||
cd "$path"
|
||||
pwd
|
||||
|
||||
#Set default mime type
|
||||
if [ -n "$MIME_TYPE" ]; then
|
||||
xdg-mime default "$DEB_PACKAGE_NAME".desktop "$MIME_TYPE"
|
||||
fi
|
||||
|
||||
CallProcess "$@"
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
if [ ! -f "$WINEPREFIX/../.QQ_run" ]; then
|
||||
debug_log "first run time"
|
||||
$SHELL_DIR/add_hotkeys
|
||||
####似乎是给dde-control-center添加快捷键
|
||||
$SHELL_DIR/fontconfig
|
||||
####暂时无法得知用途和用法
|
||||
# If the bottle not exists, run reg may cost lots of times
|
||||
# So create the bottle befor run reg
|
||||
env WINEPREFIX="$WINEPREFIX" $WINE_CMD uninstaller --list
|
||||
touch $WINEPREFIX/../.QQ_run
|
||||
fi
|
||||
|
||||
CallProcess "$@"
|
||||
|
||||
#disable Tencent MiniBrowser
|
||||
_DeleteRegistry "HKCU\\Software\\Tencent\\MiniBrowser"
|
||||
@@ -0,0 +1,5 @@
|
||||
if [ -f "${WINEPREFIX}/drive_c/Program Files/Tencent/QQLive/Upgrade.dll" ]; then
|
||||
rm -rf "${WINEPREFIX}/drive_c/Program Files/Tencent/QQLive/Upgrade.dll"
|
||||
fi
|
||||
|
||||
CallProcess "$@"
|
||||
@@ -0,0 +1,9 @@
|
||||
if [ -d "${WINEPREFIX}/drive_c/users/${USER}/Application Data/Tencent/WXWork/Update" ]; then
|
||||
rm -rf "${WINEPREFIX}/drive_c/users/${USER}/Application Data/Tencent/WXWork/Update"
|
||||
fi
|
||||
if [ -d "${WINEPREFIX}/drive_c/users/${USER}/Application Data/Tencent/WXWork/upgrade" ]; then
|
||||
rm -rf "${WINEPREFIX}/drive_c/users/${USER}/Application Data/Tencent/WXWork/upgrade"
|
||||
fi
|
||||
#Support use native file dialog
|
||||
|
||||
CallProcess "$@"
|
||||
@@ -0,0 +1,9 @@
|
||||
#/bin/bash
|
||||
chmod 700 "$WINEPREFIX/drive_c/Program Files/AliWangWang/9.12.10C/wwbizsrv.exe"
|
||||
chmod 700 "$WINEPREFIX/drive_c/Program Files/Alibaba/wwbizsrv/wwbizsrv.exe"
|
||||
if [ $# = 3 ] && [ -z "$3" ];then
|
||||
EXEC_PATH="c:/Program Files/AliWangWang/9.12.10C/WWCmd.exe"
|
||||
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$EXEC_PATH" "$2" &
|
||||
else
|
||||
CallProcess "$@"
|
||||
fi
|
||||
@@ -0,0 +1,2 @@
|
||||
export DISABLE_RENDER_CLIPBOARD=1
|
||||
CallProcess "$@"
|
||||
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
#change current dir to excute path
|
||||
path=$(dirname "$path")
|
||||
cd "$path"
|
||||
pwd
|
||||
|
||||
#Set default mime type
|
||||
if [ -n "$MIME_TYPE" ]; then
|
||||
xdg-mime default "$DEB_PACKAGE_NAME".desktop "$MIME_TYPE"
|
||||
fi
|
||||
|
||||
debug_log_to_file "Starting process $* ..."
|
||||
if [ -n "$2" ];then
|
||||
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$1" "--url=$2" &
|
||||
else
|
||||
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$1" &
|
||||
fi
|
||||
@@ -0,0 +1,3 @@
|
||||
rm -f "$WINEPREFIX/system.reg"
|
||||
cp $APPDIR/system.reg "$WINEPREFIX/system.reg"
|
||||
CallProcess "$@"
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
CallProcess "$@"
|
||||
sleep 2
|
||||
/opt/apps/com.163.music.spark/files/disable_cloudmusic_shadows
|
||||
@@ -0,0 +1,3 @@
|
||||
CallProcess "$@"
|
||||
sleep 2
|
||||
/opt/apps/com.163.dashi.mailmaster.spark/files/disable_mailmaster_shadows
|
||||
@@ -0,0 +1,4 @@
|
||||
if [ -f "${WINEPREFIX}/drive_c/ProgramData/Microsoft/Windows/Start\ Menu/Programs/MuBu.lnk" ]; then
|
||||
chmod 555 ${WINEPREFIX}/drive_c/ProgramData/Microsoft/Windows/Start\ Menu/Programs/MuBu.lnk
|
||||
fi
|
||||
CallProcess "$@"
|
||||
@@ -0,0 +1 @@
|
||||
Deepin-QQ.sh
|
||||
@@ -0,0 +1,16 @@
|
||||
if [ -e ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic/QQMusic.exe ]; then
|
||||
sleep 1
|
||||
rm -rf ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic/*.log
|
||||
else
|
||||
mkdir ${WINEPREFIX}/drive_c/Program\ Files/Tencent/updatetemp
|
||||
mv ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic/*.dll ${WINEPREFIX}/drive_c/Program\ Files/Tencent/updatetemp
|
||||
mv ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic/*.exe ${WINEPREFIX}/drive_c/Program\ Files/Tencent/updatetemp
|
||||
mv ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic/*.rdb ${WINEPREFIX}/drive_c/Program\ Files/Tencent/updatetemp
|
||||
mv ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic/*.log ${WINEPREFIX}/drive_c/Program\ Files/Tencent/updatetemp
|
||||
mv ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic/QQMusic* ${WINEPREFIX}/drive_c/Program\ Files/Tencent
|
||||
rm -rf ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic
|
||||
rm -rf ${WINEPREFIX}/drive_c/Program\ Files/Tencent/updatetemp
|
||||
rm -rf ${WINEPREFIX}/drive_c/Program\ Files/Tencent/*.log
|
||||
mv ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic* ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic
|
||||
fi
|
||||
CallProcess "$@"
|
||||
@@ -0,0 +1 @@
|
||||
Deepin-TIM.sh
|
||||
@@ -0,0 +1 @@
|
||||
Deepin-WXWork.sh
|
||||
@@ -0,0 +1,6 @@
|
||||
if [ -f "${WINEPREFIX}/drive_c/users/${USER}/Application Data/douyin" ]; then
|
||||
rm "${WINEPREFIX}/drive_c/users/${USER}/Application Data/douyin"
|
||||
mv ${WINEPREFIX}/drive_c/users/${USER}/Application\ Data/*.tmp ${WINEPREFIX}/drive_c/users/${USER}/Application\ Data/douyin
|
||||
chmod 755 ${WINEPREFIX}/drive_c/users/${USER}/Application\ Data/douyin
|
||||
fi
|
||||
CallProcess "$@"
|
||||
@@ -0,0 +1,2 @@
|
||||
DisableWrite ${WINEPREFIX}/drive_c/users/${USER}/Temp
|
||||
CallProcess "$@"
|
||||
@@ -0,0 +1,5 @@
|
||||
if [ -w ${WINEPREFIX}/drive_c/users/${USER}/Application\ Data/飞项/Crashpad/reports ]; then
|
||||
rm -rf ${WINEPREFIX}/drive_c/users/${USER}/Application\ Data/飞项/Crashpad/reports/*
|
||||
chmod 555 ${WINEPREFIX}/drive_c/users/${USER}/Application\ Data/飞项/Crashpad/reports
|
||||
fi
|
||||
CallProcess "$@"
|
||||
@@ -0,0 +1,37 @@
|
||||
echo
|
||||
echo "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⡟⠉⠻⣷⡄⠀⠀⠀⠀⠀⠀⢀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣴⣶⣶⣿⣿⡄⠀⠀⢀⣤⣾⠿⠻⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣤⣾⣿⣏⡁⠀⠀⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⡿⢿⣿⣯⣀⣿⣿⡿⢿⣿⣿⣿⣿⣿⣷⣄⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣶⣬⡙⠿⠋⣡⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⣀⣀⣀⣀⣀⠀⠀⠀⠀⠀⠈⢻⣿⣿⠟⣁⣴⣤⡙⠻⣿⣿⣿⣿⣿⣿⣿⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠺⢿⣿⣿⣿⢿⠇⠀⠀⠀⠀⠀⠀⠹⣷⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠛⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⣖⣆⣀⣀⣀⣀⣀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⣿⠟⠛⠛⠛⠛⠛⠛⠛⠷⠿⠿⢿⣷⣶⣤⣤⣀⣸⣿⣿⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠛⢻⡏⠁⣈⢻⠙⣿⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠛⣲⡟⠞⢀⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⣿⡇⠀⠀⠀⠀⢀⣀⣀⣤⣤⣤⣤⣤⣶⣶⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⣿⣷⣶⣾⡿⠿⠿⠛⢛⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣄⠀⠀⠀⠀⠀⠀⠀⢀⣠⡤⣀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠙⠋⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡄⠀⠀⠀⢠⣾⣿⣿⣿⣿⡆⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⣠⣿⣿⣿⣿⣥⣼⣿⣿⣿⣿⣿⣿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣆⠀⠀⠸⠽⠻⣿⡿⠟⠁⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣾⣿⣁⣼⣿⣿⣿⣿⣿⢻⣿⡀⠙⣿⣿⣿⣿⣿⣧⠀⠀⠀⠀⣀⣤⣤⣄⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⢰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣾⣿⣿⣶⣿⣿⣿⣿⣿⣿⣇⠀⠀⠀⢿⣿⣿⣿⠇⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⠀⠀⠀⠉⠉⠁⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⡿⠿⠾⣿⣿⣿⣿⣿⣿⣿⡿⠷⣬⡻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣄⠀⢘⣿⣿⣿⣿⣿⠏⠀⠀⣀⣤⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠻⣿⣿⣿⣿⣿⣿⣿⣿⠁⠀⠈⠙⢿⣿⣷⣾⣿⠿⣿⣿⣇⣤⣶⣿⣿⠿⠛⠋⠙⠻⣿⣿⣿⣿⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠉⠻⣿⣿⣿⣿⣷⠀⠀⣠⣶⣿⠿⠉⠁⠀⠀⠀⠉⠉⠉⠻⣿⣷⣄⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⣤⣤⣤⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠙⠿⣿⣿⣿⣷⠿⡿⠋⠀⠀⠀⠀⣄⢀⣀⠀⠀⠀⠀⠀⠙⢿⣷⣄⠀⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠛⠀⠀⠀⠀⠀
|
||||
⣀⣀⠀⠀⠀⠀⢀⣴⣿⣿⠛⠀⠀⢸⣧⡿⠀⠀⣸⠋⠋⠉⢻⡄⠀⠀⠀⠀⠀⠉⢁⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠋⠁⠀⠀⠀⠀⠀⠀⠀
|
||||
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠈⠀⠀⠀⢻⣀⣀⣀⣀⡿⠀⠀⠀⠀⠀⠀⠀⢉⣭⣭⣽⣿⣿⣿⣿⣿⣿⣿⣿⣦⣄⠀⠀⠀⠀⠀⣀⣤⡄
|
||||
⠘⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣄⣀⠀⠀⠀⠉⠀⠀⠉⠀⠀⠀⠀⠀⢀⣀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃
|
||||
⠀⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢟⣿⣿⣿⣿⣶⣶⡶⣶⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃⠀
|
||||
⠀⠀⠀⠈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣿⢿⡸⣿⣿⣿⣿⣎⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀⠀⠀
|
||||
⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⣽⣿⣿⡟⠁⠀⢙⣿⣿⣿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⠉⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣿⣿⣿⣿⣿⣦⣶⣿⣿⣿⣿⣿⡿⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠇⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⢿⣿⣿⣿⣿⣿⣿⣿⡿⠁⠀⠘⣿⣿⡿⠟⠉⢿⣯⣿⣿⣿⠁⠀⠀⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠙⠿⣿⣿⣿⣿⣿⡇⠀⠀⢸⡟⠋⠀⠀⠀⠀⠙⠛⠋⢸⠀⠀⠀⠀⠀⠘⣿⣿⣿⣿⣿⣿⣿⡿⠿⠛⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⢻⣿⠀⠀⠀⢸⡇⠀⠀⠀⠀⠀⠀⠀⠀⢸⡆⠀⠀⠀⠀⠀⢻⣿⣿⣿⣿⠟⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀"
|
||||
|
||||
echo "以此纪念2.4.0版本"
|
||||
CallProcess "$@"
|
||||
@@ -0,0 +1 @@
|
||||
Deepin-QQ.sh
|
||||
@@ -0,0 +1 @@
|
||||
Deepin-WXWork.sh
|
||||
42
spark-dwine-helper/s-wine-helper/opt/spark-dwine-helper/spark_updater
Executable file
42
spark-dwine-helper/s-wine-helper/opt/spark-dwine-helper/spark_updater
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/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
|
||||
|
||||
# 使用cp命令覆盖同名文件
|
||||
cp -rf "$source_dir"/* "$destination_dir"
|
||||
|
||||
echo "文件复制完成!"
|
||||
exit 0
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
TRANSHELL_CONTENT_UNPACKING="Preparing the following APP:"
|
||||
TRANSHELL_CONTENT_SPARK_WINDOWS_COMPATIBILITY_TOOL="Spark Windows APP Compatibility Helper"
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
TRANSHELL_CONTENT_UNPACKING="正在为您准备以下应用:"
|
||||
TRANSHELL_CONTENT_SPARK_WINDOWS_COMPATIBILITY_TOOL="星火Windows应用兼容助手"
|
||||
|
||||
1
spark-dwine-helper/s-wine-helper/usr/bin/spark-wine-launcher
Symbolic link
1
spark-dwine-helper/s-wine-helper/usr/bin/spark-wine-launcher
Symbolic link
@@ -0,0 +1 @@
|
||||
../../opt/spark-dwine-helper/spark-dwine-helper/wine-app-launcher/spark-wine-launcher
|
||||
@@ -0,0 +1,13 @@
|
||||
[Desktop Entry]
|
||||
Categories=Utility;
|
||||
Encoding=UTF-8
|
||||
Exec=bash -c "/opt/spark-dwine-helper/spark-dwine-helper/wine-app-settings/settings.sh"
|
||||
Icon=spark-dwine-helper
|
||||
MimeType=
|
||||
Name=Spark Store Wine App Settings
|
||||
Name[zh_CN]=星火商店Wine应用设置
|
||||
NoDisplay=false
|
||||
StartupWMClass=spark-dwine-helper
|
||||
Terminal=False
|
||||
Type=Application
|
||||
X-Deepin-Vendor=user-custom
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 416 KiB |
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg width="800px" height="800px" viewBox="0 0 72 72" id="emoji" xmlns="http://www.w3.org/2000/svg">
|
||||
<g id="color">
|
||||
<path fill="#D0CFCE" stroke="none" d="M13.8627,12.1552c-1.1508,0-2.0876,0.9362-2.0876,2.0876v43.5128c0,1.1508,0.9368,2.0876,2.0876,2.0876 h43.5139c1.1508,0,2.0876-0.9368,2.0876-2.0876V14.2428c0-1.1514-0.9368-2.0876-2.0876-2.0876H13.8627z"/>
|
||||
<path fill="#9B9B9A" stroke="none" d="M18.3877,47.8604c0-0.5528,1.4504,2.0709,1.4504,2.0709s2.3432,2.9292,4.5493,2.9292s5-2.794,5-5 c0-2.2061-0.7639-4.5707-2.97-4.5707c-0.5527,0-2.5849-1.4257-2.0346-1.4285c-0.0067,0-0.0132-0.0009-0.0198-0.0009 c-1.5741,0-3.002,0.6109-4.0723,1.6024l-1.2249,1.5816c-0.4475,0.84-0.703,1.7979-0.703,2.8161"/>
|
||||
<path fill="#9B9B9A" stroke="none" d="M50.8994,43.6182c0.3906,0.3906-1.0234,0.5113-1.414,0.1206c-1.5118-1.5117-4.1456-1.7685-5.6573-0.2568 c-0.7558,0.7559-2.3559,2.969-2.3559,4.0374c0,1.0683,0.8929,3.1207,1.6487,3.8766c1.5586,1.5585,4.7518,1.8046,6.3124,0.2461 c0.3906-0.3907,1.8563,0.0683,1.4677,0.459c0.8179-0.8186,1.3997-1.8728,1.6368-3.0517l0.0579-1.9982 c-0.2074-1.5344-0.9886-2.8865-2.128-3.8247C50.6166,43.3495,50.761,43.4797,50.8994,43.6182z"/>
|
||||
<path fill="#9B9B9A" stroke="none" d="M30.302,24.7566c-0.1589-1.1738-0.6542-2.2388-1.3899-3.095c0.2868,0.4086-0.9581,0.4745-1.3262,0.0629 c-0.7139-0.7949-1.6947-1.0792-2.7611-1.1373c-1.0722-0.0499-2.9824,0.2682-3.7783,0.981 c-0.7949,0.7139-1.6015,2.4796-1.6591,3.5465c-0.0586,1.0674-0.1538,2.4763,0.5601,3.2713 c0.7138,0.7954,3.157,2.3541,4.2244,2.4117c1.0576,0.0508,4.6217-1.235,4.2928-0.8597c0.891-0.8364,1.5295-1.9377,1.7797-3.1826 L30.302,24.7566z"/>
|
||||
<path fill="#9B9B9A" stroke="none" d="M51.7237,22.3636l-1.3348-1.4893c-0.9584-0.7633-2.1552-1.235-3.4612-1.2935 c0.5337,0.0405-1.3506,1.1086-1.3506,1.1086s-3.8299,2.4771-3.9168,4.6807c-0.086,2.2031,2.6346,5.145,4.8387,5.2329 c2.2002,0.0898,4.958-1.7837,5.0449-3.9873c0.0215-0.5522,1.1056-1.3812,1.1023-0.8443c0.0024-0.0684,0.0104-0.1352,0.0104-0.2042 C52.6566,24.3878,52.3115,23.2913,51.7237,22.3636z"/>
|
||||
</g>
|
||||
<g id="hair"/>
|
||||
<g id="skin"/>
|
||||
<g id="skin-shadow"/>
|
||||
<g id="line">
|
||||
<path fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M56.4636,59.8432h-41.688c-1.6569,0-3-1.3431-3-3v-41.688c0-1.6569,1.3431-3,3-3h41.688c1.6569,0,3,1.3431,3,3v41.688 C59.4636,58.5001,58.1205,59.8432,56.4636,59.8432z"/>
|
||||
<path fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M51.6525,25.7643c-0.1089,2.7593-2.434,4.9079-5.1932,4.799c-2.7594-0.1089-4.9079-2.434-4.799-5.1932 c0.1089-2.7593,2.4339-4.9079,5.1932-4.799"/>
|
||||
<path fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M27.7268,29.2886c-2.0552,1.8442-5.2165,1.6732-7.0608-0.382c-1.8442-2.0552-1.6732-5.2165,0.382-7.0608 c2.0552-1.8442,5.2165-1.6732,7.0608,0.382"/>
|
||||
<path fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M50.1919,51.396c-1.9526,1.9527-5.1184,1.9526-7.071,0c-1.9527-1.9526-1.9527-5.1184,0-7.071c1.9526-1.9526,5.1184-1.9527,7.071,0"/>
|
||||
<path fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M24.3874,42.8605c2.7614,0,5,2.2386,5,5c0,2.7615-2.2386,5-5,5c-2.7614,0-5-2.2385-5-5"/>
|
||||
<line x1="24.3874" x2="18.7823" y1="47.8605" y2="43.5674" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2"/>
|
||||
<line x1="53.492" x2="46.6564" y1="48.0799" y2="47.8605" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2"/>
|
||||
<line x1="31.3463" x2="24.1665" y1="25.7985" y2="25.5152" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2"/>
|
||||
<line x1="51.6564" x2="46.6564" y1="21.0804" y2="25.5672" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2"/>
|
||||
</g>
|
||||
|
After Width: | Height: | Size: 4.2 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="144px" height="144px"><g id="Layer_1"><linearGradient id="SVGID_1_" x1="6.001" x2="22.807" y1="29.396" y2="29.396" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#33bef0"/><stop offset="1" stop-color="#22a5e2"/></linearGradient><path fill="url(#SVGID_1_)" d="M22.8,24.5l-3.5,12.1c-3-2.1-6.3-3.7-13.3-0.8l3.4-11.9l0,0C16.4,20.9,19.8,22.4,22.8,24.5z"/><linearGradient id="SVGID_00000064344804604185625220000003582743550301639556_" x1="39.149" x2="17.839" y1="32.84" y2="32.84" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fede00"/><stop offset="1" stop-color="#ffd000"/></linearGradient><path fill="url(#SVGID_00000064344804604185625220000003582743550301639556_)" d="M24.6,25.7l-3.4,11.9 c3,2.1,6.4,3.7,13.4,0.8l3.3-11.6C30.8,29.2,27.7,27.7,24.6,25.7z"/><linearGradient id="SVGID_00000067194281375023334940000000214048285996100276_" x1="10.011" x2="26.828" y1="15.169" y2="15.169" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#f44f5a"/><stop offset=".443" stop-color="#ee3d4a"/><stop offset="1" stop-color="#e52030"/></linearGradient><path fill="url(#SVGID_00000067194281375023334940000000214048285996100276_)" d="M23.4,22.3l3.4-12 c-3-2.1-6.4-3.7-13.4-0.8l-3.4,12c2.8-1.2,5-1.7,6.8-1.7C19.6,19.9,21.6,21.1,23.4,22.3z"/><linearGradient id="SVGID_00000104673114758685606420000016406648196720083331_" x1="35.787" x2="19.822" y1="18.835" y2="18.835" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#21ad64"/><stop offset="1" stop-color="#088242"/></linearGradient><path fill="url(#SVGID_00000104673114758685606420000016406648196720083331_)" d="M28.6,11.6l-3.4,12 c3,2.1,6.7,3.8,13.4,0.7l3.4-12C35,15.3,31.7,13.7,28.6,11.6z"/></g></svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1,17 @@
|
||||
<svg width="100" height="100" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<!-- 背景 -->
|
||||
<rect width="24" height="24" rx="5" fill="#f2f2f2"/>
|
||||
|
||||
<!-- 盖子 -->
|
||||
<path d="M8 4L9 3h6l1 1h3v2H5V4h3z" fill="#888"/>
|
||||
|
||||
<!-- 垃圾桶主体(加宽底部) -->
|
||||
<path d="M6 7h12l-1.5 12H7.5L6 7z" fill="#555"/>
|
||||
|
||||
<!-- 竖线,增强立体感 -->
|
||||
<path d="M8 9v8M10 9v8M12 9v8M14 9v8M16 9v8" stroke="#777" stroke-width="1"/>
|
||||
|
||||
<!-- 红色 X 代表卸载 -->
|
||||
<circle cx="18" cy="6" r="4" fill="#ff5f5f"/>
|
||||
<path d="M16.5 4.5l3 3m0-3l-3 3" stroke="white" stroke-width="1.5"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 624 B |
40
打包用例/postinst
Normal file
40
打包用例/postinst
Normal file
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
PACK_NAME="$DPKG_MAINTSCRIPT_PACKAGE" #软件包名
|
||||
BOTTLE_NAME="" #容器名
|
||||
ACTIVEX_NAME=""
|
||||
MAKE_AUTOSTART="" #若需要开机自启,则填写1
|
||||
|
||||
|
||||
make_autostart()
|
||||
{
|
||||
for username in $(ls /home)
|
||||
do
|
||||
echo /home/$username
|
||||
if [ -d "/home/$username/.config/autostart" ]
|
||||
then
|
||||
cp /opt/apps/$PACK_NAME/entries/applications/$PACK_NAME.desktop /home/$username/.config/autostart/
|
||||
sed -i "s#%u#\"autostart\"#" /home/$username/.config/autostart/$PACK_NAME.desktop
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
|
||||
if [ -n "$MAKE_AUTOSTART" ]; then
|
||||
make_autostart
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if [ -n "$ACTIVEX_NAME" ]; then
|
||||
if [ ! -d "/usr/lib/mozilla/plugins" ];then
|
||||
mkdir -p /usr/lib/mozilla/plugins
|
||||
fi
|
||||
cp /usr/local/share/pipelight/libpipelight.so /usr/lib/mozilla/plugins/libpipelight-$ACTIVEX_NAME.so
|
||||
fi
|
||||
|
||||
# Make sure the script returns 0
|
||||
true
|
||||
|
||||
|
||||
58
打包用例/postrm
Normal file
58
打包用例/postrm
Normal file
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
if [ "$1" = "remove" ] || [ "$1" = "purge" ];then
|
||||
|
||||
echo "清理卸载残留"
|
||||
BOTTLE_NAME="" #在引号中填写容器名
|
||||
PACK_NAME="$DPKG_MAINTSCRIPT_PACKAGE"
|
||||
ACTIVEX_NAME="" #activex相关,若未使用,可不设置
|
||||
MAKE_AUTOSTART="" #如果先前设置了开机自启,则在此处填写1
|
||||
|
||||
|
||||
|
||||
### 以下为功能段,若只用于打包则以下内容可不看,只填写上方即可
|
||||
|
||||
make_autostart()
|
||||
{
|
||||
for username in $(ls /home)
|
||||
do
|
||||
echo /home/$username
|
||||
if [ -d "/home/$username/.config/autostart" ]
|
||||
then
|
||||
rm /home/$username/.config/autostart/$PACK_NAME.desktop
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
|
||||
if [ -n "$MAKE_AUTOSTART" ]; then
|
||||
make_autostart
|
||||
fi
|
||||
|
||||
|
||||
if [ -n "$ACTIVEX_NAME" ]; then
|
||||
rm /usr/lib/mozilla/plugins/libpipelight-$ACTIVEX_NAME.so
|
||||
fi
|
||||
|
||||
|
||||
if [ -z $BOTTLE_NAME ];then
|
||||
echo "W: 没有指定容器,跳过清理容器。请手动前往 ~/.deepinwine/ 下删除"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ -e /opt/apps/store.spark-app.spark-dwine-helper/files/deepinwine/tools/spark_kill.sh ];then
|
||||
/opt/apps/store.spark-app.spark-dwine-helper/files/deepinwine/tools/spark_kill.sh $BOTTLE_NAME
|
||||
###这里注意,如果没写BOTTLE_NAME,会把QQ杀了
|
||||
fi
|
||||
|
||||
for username in $(ls /home)
|
||||
do
|
||||
echo /home/$username
|
||||
if [ -d /home/$username/.deepinwine/$BOTTLE_NAME ]
|
||||
then
|
||||
rm -rf /home/$username/.deepinwine/$BOTTLE_NAME
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "非卸载,跳过清理"
|
||||
fi
|
||||
16
打包用例/pre_update.sh
Normal file
16
打包用例/pre_update.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
function Remove_Bottle_Before_Update(){
|
||||
local BOTTLENAME="容器名"
|
||||
echo "$HOME/.deepinwine/${BOTTLENAME} is going to be deleted before Update"
|
||||
chmod -R +w $HOME/.deepinwine/${BOTTLENAME}
|
||||
rm -rf $HOME/.deepinwine/${BOTTLENAME}
|
||||
}
|
||||
|
||||
|
||||
#########这是个例子,对于那些需要删除容器再更新的软件用的,不是每个都需要
|
||||
|
||||
function CallPreUpdate(){
|
||||
|
||||
Remove_Bottle_Before_Update
|
||||
DeployApp
|
||||
########这里是非常非常坑,虽然名字是pre_update但是实际上会直接替换掉整个update过程,所以deploy也需要加上
|
||||
}
|
||||
165
打包用例/run.sh
Executable file
165
打包用例/run.sh
Executable file
@@ -0,0 +1,165 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2016 Deepin, Inc.
|
||||
#
|
||||
# Author: Li LongYu <lilongyu@linuxdeepin.com>
|
||||
# Peng Hao <penghao@linuxdeepin.com>
|
||||
#
|
||||
#
|
||||
# Copyright (C) 2022 The Spark Project
|
||||
#
|
||||
#
|
||||
# Modifier shenmo <shenmo@spark-app.store>
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
#######################函数段。下文调用的额外功能会在此处声明
|
||||
|
||||
version_gt() { test "$(echo "$@" | tr " " "
|
||||
" | sort -V | head -n 1)" != "$1"; }
|
||||
|
||||
extract_archive()
|
||||
{
|
||||
archive=$1
|
||||
version_file=$2
|
||||
dest_dir=$3
|
||||
if [ -f "$archive" ] && [ -n "$dest_dir" ] && [ "$dest_dir" != "." ];then
|
||||
archive_version=`cat $version_file`
|
||||
if [ -d "$dest_dir" ];then
|
||||
if [ -f "$dest_dir/VERSION" ];then
|
||||
dest_version=`cat $dest_dir/VERSION`
|
||||
if version_gt "$archive_version" "$dest_version";then
|
||||
7z x "$archive" -o/"$dest_dir" -aoa
|
||||
echo "$archive_version" > "$dest_dir/VERSION"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
mkdir -p $dest_dir
|
||||
7z x "$archive" -o/"$dest_dir" -aoa
|
||||
echo "$archive_version" > "$dest_dir/VERSION"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
Get_Dist_Name()
|
||||
{
|
||||
if grep -Eqii "Deepin" /etc/issue || grep -Eq "Deepin" /etc/*-release; then
|
||||
DISTRO='Deepin'
|
||||
elif grep -Eqi "UnionTech" /etc/issue || grep -Eq "UnionTech" /etc/*-release; then
|
||||
DISTRO='UniontechOS'
|
||||
elif grep -Eqi "GXDE" /etc/issue || grep -Eq "GXDE" /etc/*-release; then
|
||||
DISTRO='GXDE'
|
||||
elif grep -Eqi "UOS" /etc/issue || grep -Eq "UOS" /etc/*-release; then
|
||||
DISTRO='UniontechOS'
|
||||
else
|
||||
DISTRO='OtherOS'
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
####获得发行版名称
|
||||
|
||||
#########################预设值段
|
||||
|
||||
version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; }
|
||||
####用于比较版本?未实装
|
||||
BOTTLENAME="容器名"
|
||||
APPVER="版本号"
|
||||
EXEC_PATH="启动路径"
|
||||
##### 软件在wine中的启动路径
|
||||
## Priority Policy: 软件自带>spark-dwine-helper>deepin-wine-helper
|
||||
SHELL_DIR=$(dirname $(realpath $0))
|
||||
START_SHELL_PATH="/opt/deepinwine/tools/run_v4.sh" ## Fallback
|
||||
if [ -e "/opt/deepinwine/tools/spark_run_v4.sh" ] ;then
|
||||
START_SHELL_PATH="/opt/deepinwine/tools/spark_run_v4.sh"
|
||||
fi
|
||||
## If exist spark dwine helper, then use it as default
|
||||
if [ -e "$SHELL_DIR/deepinwine/tools/spark_run_v4.sh" ] ;then
|
||||
# 如果 helper 在 run.sh 相同目录的 deepinwine/tools/spark_run_v4.sh 则可以调用
|
||||
START_SHELL_PATH="$SHELL_DIR/deepinwine/tools/spark_run_v4.sh"
|
||||
fi
|
||||
## If
|
||||
ENABLE_DOT_NET=""
|
||||
####若使用spark-wine时需要用到.net,则请把ENABLE_DOT_NET设为true,同时在依赖中写spark-wine7-mono
|
||||
#export BOX86_EMU_CMD="/opt/spark-box86/box86"
|
||||
####仅在Arm且不可使用exagear时可用,作用是强制使用box86而不是deepin-box86.如果你想要这样做,请取消注释
|
||||
export MIME_TYPE=""
|
||||
|
||||
export DEB_PACKAGE_NAME="包名"
|
||||
####这里写包名才能在启动的时候正确找到files.7z,似乎也和杀残留进程有关
|
||||
export APPRUN_CMD="deepin-wine6-stable"
|
||||
#####wine启动指令,建议
|
||||
#EXPORT_ENVS="wine的动态链接库路径"
|
||||
##例如我的wine应用是使用的dwine6的32位容器,那么我要填LD_LIBRARY_PATH=$LD_LIBRARY;/opt/deepin-wine6-stable/lib
|
||||
## 如果用不到就不填,不要删除前面的注释用的#
|
||||
|
||||
export SPECIFY_SHELL_DIR=`dirname $START_SHELL_PATH`
|
||||
|
||||
ARCHIVE_FILE_DIR="/opt/apps/$DEB_PACKAGE_NAME/files"
|
||||
|
||||
export WINEDLLPATH=/opt/$APPRUN_CMD/lib:/opt/$APPRUN_CMD/lib64
|
||||
|
||||
export WINEPREDLL="$ARCHIVE_FILE_DIR/dlls"
|
||||
|
||||
DISABLE_ATTACH_FILE_DIALOG=""
|
||||
##默认为空。若为1,则不使用系统自带的文件选择,而是使用wine的
|
||||
##对于deepin/UOS,大部分的应用都不需要使用wine的,如果有需求(比如wine应用选择的限定种类文件系统的文管不支持)
|
||||
##请填1。
|
||||
##注意:因为非DDE的环境不确定,所以默认会在非Deepin/UOS发行版上禁用这个功能。如果你确认在适配的发行版上可以正常启动,请注释或者删除下面这段
|
||||
|
||||
##############<<<<<<<<<禁用文件选择工具开始
|
||||
Get_Dist_Name
|
||||
#此功能实现参见开头函数段
|
||||
if [ "$DISTRO" != "Deepin" ] && [ "$DISTRO" != "UniontechOS" ]&& [ "$DISTRO" != "GXDE" ];then
|
||||
DISABLE_ATTACH_FILE_DIALOG="1"
|
||||
echo "非deepin/UOS,默认关闭系统自带的文件选择工具,使用Wine的"
|
||||
echo "如果你想改变这个行为,请到/opt/apps/$DEB_PACKAGE_NAME/files/$0处修改"
|
||||
echo "To打包者:如果你要打开自带请注意在适配的发行版上进行测试"
|
||||
echo "To用户:打包者没有打开这个功能,这证明启用这个功能可能造成运行问题。如果你要修改这个行为,请确保你有一定的动手能力"
|
||||
fi
|
||||
##############>>>>>>>>>禁用文件选择工具结束
|
||||
|
||||
##############<<<<<<<<<屏蔽mono和gecko安装器开始
|
||||
##默认屏蔽mono和gecko安装器
|
||||
if [ "$APPRUN_CMD" = "spark-wine9" ] || [ "$APPRUN_CMD" = "spark-wine" ]|| [ "$APPRUN_CMD" = "spark-wine8" ] && [ -z "$ENABLE_DOT_NET" ];then
|
||||
|
||||
#export WINEDLLOVERRIDES="mscoree=d,mshtml=d,control.exe=d"
|
||||
export WINEDLLOVERRIDES="control.exe=d"
|
||||
#### "为了降低打包体积,默认关闭gecko和momo,如有需要,注释此行(仅对spark-wine7-devel有效)"
|
||||
|
||||
fi
|
||||
##############>>>>>>>>>屏蔽mono和gecko安装器结束
|
||||
|
||||
##############<<<<<<<<<解压自行封装的 Wine(如果存在的话)
|
||||
if [[ -e "$ARCHIVE_FILE_DIR/wine_archive.7z" ]]; then
|
||||
WINE_BIN_DIR=`dirname $APPRUN_CMD`
|
||||
WINE_DIR=`dirname $WINE_BIN_DIR`
|
||||
extract_archive "$ARCHIVE_FILE_DIR/wine_archive.7z" "$ARCHIVE_FILE_DIR/wine_archive.md5sum" "$WINE_DIR"
|
||||
fi
|
||||
##############>>>>>>>>>
|
||||
|
||||
#########################执行段
|
||||
|
||||
|
||||
|
||||
|
||||
if [ -z "$DISABLE_ATTACH_FILE_DIALOG" ];then
|
||||
export ATTACH_FILE_DIALOG=1
|
||||
fi
|
||||
|
||||
if [ -n "$EXPORT_ENVS" ];then
|
||||
export $EXPORT_ENVS
|
||||
fi
|
||||
|
||||
if [ -n "$EXEC_PATH" ];then
|
||||
if [ -z "${EXEC_PATH##*.lnk*}" ];then
|
||||
$START_SHELL_PATH $BOTTLENAME $APPVER "C:/windows/command/start.exe" "/Unix" "$EXEC_PATH" "$@"
|
||||
else
|
||||
$START_SHELL_PATH $BOTTLENAME $APPVER "$EXEC_PATH" "$@"
|
||||
fi
|
||||
else
|
||||
$START_SHELL_PATH $BOTTLENAME $APPVER "uninstaller.exe" "$@"
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user