mirror of
https://gitee.com/spark-store-project/spark-wine
synced 2025-12-18 21:11:39 +08:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 08f2da0038 | |||
| 57a3262264 | |||
| e893040b98 | |||
| 3e36c11e88 | |||
| 14f366bb46 | |||
| cbf7dbd838 | |||
| 6c672fdf55 | |||
| b48c1adad9 | |||
| 52fcf57512 | |||
| 46d8e02d9c | |||
| 0a0d3f4055 | |||
| a3b83b1b91 | |||
| 6694c47fe4 | |||
| 04b3e1dd9b | |||
| 09dadd36e8 | |||
| 18845940e1 | |||
| d8671e5863 | |||
| c863f369b6 | |||
| 3ec2118ddb |
128
spark-dwine-helper/build.sh
Executable file
128
spark-dwine-helper/build.sh
Executable file
@@ -0,0 +1,128 @@
|
||||
#/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/opt
|
||||
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:amd64, p7zip-full:amd64, fonts-noto-cjk,deepin-wine-helper(>=5.1)
|
||||
Section: utils
|
||||
Priority: extra
|
||||
Recommends: spark-dwine-helper-settings
|
||||
Multi-Arch: foreign
|
||||
Replaces: store.spark-app.spark-dwine-helper(<=$version)
|
||||
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 "普通deb包已经准备好,正在生成UOS deb包"
|
||||
rm -rf pkg/
|
||||
#################################################################
|
||||
mkdir -p pkg/DEBIAN
|
||||
cp -r package-source/uos-assets/opt pkg/
|
||||
cp -r s-wine-helper/* pkg/opt
|
||||
|
||||
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,mipsel64,sw64"],
|
||||
"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:amd64, p7zip-full:amd64, fonts-noto-cjk,deepin-wine-helper(>=5.1)
|
||||
Section: utils
|
||||
Priority: extra
|
||||
Recommends: spark-dwine-helper-settings
|
||||
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/
|
||||
########################################
|
||||
mkdir -p pkg/DEBIAN
|
||||
cp -r package-source/spark-dwine-helper-settings/* pkg/
|
||||
SIZE=`du -s ./pkg`
|
||||
SIZE=`echo ${SIZE%%.*}`
|
||||
|
||||
cat << EOF >pkg/DEBIAN/control
|
||||
Package: spark-dwine-helper-settings
|
||||
Version: 1.0
|
||||
Architecture: all
|
||||
Maintainer: shenmo <shenmo@spark-app.store>
|
||||
Installed-Size: $SIZE
|
||||
Depends: spark-dwine-helper(>=1.6)
|
||||
Section: utils
|
||||
Priority: extra
|
||||
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 "helper deb包已经准备好"
|
||||
rm -rf pkg/
|
||||
@@ -0,0 +1,102 @@
|
||||
#/bin/bash
|
||||
|
||||
|
||||
until [ "$IS_CLOSE" = "1" ];do
|
||||
|
||||
CHOSEN_SETTINGS=`zenity --list \
|
||||
--width=700 \
|
||||
--height=350 \
|
||||
--title="欢迎使用星火wine助手控制中心,请在以下选项中选择一个执行!" \
|
||||
--column="操作" \
|
||||
设置全局缩放 \
|
||||
设置单独应用缩放 \
|
||||
以上操作仅对使用了spark-dwine-helper的应用生效 `
|
||||
|
||||
echo "$CHOSEN_SETTINGS"
|
||||
case "$CHOSEN_SETTINGS" in
|
||||
"设置全局缩放")
|
||||
########
|
||||
zenity --info --text="请注意:此选项对deepin/UOS无效,会优先读取deepin/UOS的缩放设置进行缩放" --width=500 --height=150
|
||||
|
||||
dimensions=`xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/'`
|
||||
scale_factor=`zenity --list \
|
||||
--width=700 \
|
||||
--height=350 \
|
||||
--title="您的分辨率是:$dimensions,请在以下选项中选择一个" \
|
||||
--column="缩放倍率" \
|
||||
1.0 \
|
||||
1.25 \
|
||||
1.5 \
|
||||
1.75 \
|
||||
2.0`
|
||||
|
||||
case "$scale_factor" in
|
||||
"")
|
||||
zenity --info --text="默认为1倍缩放。" --width=500 --height=150
|
||||
scale_factor="1.0"
|
||||
;;
|
||||
*)
|
||||
zenity --info --text="缩放倍数为$scale_factor。已保存!" --width=500 --height=150
|
||||
;;
|
||||
esac
|
||||
echo "$scale_factor" > $HOME/.config/spark-wine/scale.txt
|
||||
|
||||
|
||||
;;
|
||||
########
|
||||
|
||||
|
||||
|
||||
|
||||
"设置单独应用缩放")
|
||||
zenity --info --text="请在接下来的文件选择框选中所需的应用所在的容器文件夹(注意要选择文件夹)" --width=500 --height=150
|
||||
CONTAINER_PATH=`zenity --file-selection --filename="/home/shenmo/.deepinwine/" --directory`
|
||||
|
||||
if [ ! -f "$CONTAINER_PATH/user.reg" ];then
|
||||
zenity --info --text="错误:找不到user.reg.这不是一个wine容器" --width=500 --height=150
|
||||
|
||||
else
|
||||
|
||||
dimensions=`xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/'`
|
||||
scale_factor=`zenity --list \
|
||||
--width=700 \
|
||||
--height=350 \
|
||||
--title="您的分辨率是:$dimensions,请在以下选项中选择一个" \
|
||||
--column="缩放倍率" \
|
||||
1.0 \
|
||||
1.25 \
|
||||
1.5 \
|
||||
1.75 \
|
||||
2.0 \
|
||||
与全局设置同步 `
|
||||
|
||||
case "$scale_factor" in
|
||||
"")
|
||||
zenity --info --text="默认为1倍缩放。" --width=500 --height=150
|
||||
scale_factor="1.0"
|
||||
/opt/durapps/spark-dwine-helper/scale-set-helper/set-wine-scale.sh -s $scale_factor $CONTAINER_PATH
|
||||
;;
|
||||
"与全局设置同步")
|
||||
zenity --info --text="将会与全局设置同步" --width=500 --height=150
|
||||
rm $CONTAINER_PATH/scale.txt
|
||||
;;
|
||||
*)
|
||||
zenity --info --text="缩放倍数为$scale_factor。已保存!" --width=500 --height=150
|
||||
/opt/durapps/spark-dwine-helper/scale-set-helper/set-wine-scale.sh -s $scale_factor $CONTAINER_PATH
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
fi
|
||||
;;
|
||||
"以上操作仅对使用了spark-dwine-helper的应用生效")
|
||||
|
||||
;;
|
||||
|
||||
*)
|
||||
IS_CLOSE="1"
|
||||
;;
|
||||
|
||||
|
||||
esac
|
||||
done
|
||||
@@ -0,0 +1,13 @@
|
||||
[Desktop Entry]
|
||||
Categories=Utility;
|
||||
Encoding=UTF-8
|
||||
Exec=sh -c "/opt/durapps/spark-dwine-helper/spark-dwine-helper-settings/settings.sh"
|
||||
Icon=spark-dwine-helper-settings
|
||||
MimeType=
|
||||
Name=Spark Wine Helper Settings
|
||||
Name[zh_CN]=星火wine助手设置
|
||||
StartupWMClass=spark-dwine-helper-settings
|
||||
Terminal=False
|
||||
Type=Application
|
||||
NoDisplay=false
|
||||
X-Deepin-Vendor=user-custom
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 47 KiB |
@@ -0,0 +1,13 @@
|
||||
[Desktop Entry]
|
||||
Categories=Utility;
|
||||
Encoding=UTF-8
|
||||
Exec=sh -c "/opt/durapps/spark-dwine-helper/spark-dwine-helper-settings/settings.sh"
|
||||
Icon=store.spark-app.spark-dwine-helper
|
||||
MimeType=
|
||||
Name=Spark Wine Helper Settings
|
||||
Name[zh_CN]=星火wine助手设置
|
||||
StartupWMClass=spark-dwine-helper-settings
|
||||
Terminal=False
|
||||
Type=Application
|
||||
NoDisplay=true
|
||||
X-Deepin-Vendor=user-custom
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 47 KiB |
@@ -1,11 +0,0 @@
|
||||
Package: spark-dwine-helper
|
||||
Version: 1.6
|
||||
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://gitee.com/deepin-community-store/spark-wine
|
||||
Description: Spark Deepin Wine Helper
|
||||
@@ -157,6 +157,26 @@ CallProcess()
|
||||
###一些自定义的应用不会使用这个启动,而另一些则会调用这个
|
||||
###有设置mimetype和自动启动(这个暂时没分析)的功能
|
||||
|
||||
###########专属优化段:
|
||||
CallDouyin()
|
||||
{
|
||||
if [ -f "${WINEPREFIX}/drive_c/users/${USER}/Application Data/douyin" ]; then
|
||||
rm -f "${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 555 "${WINEPREFIX}/drive_c/users/${USER}/Application Data/douyin"
|
||||
fi
|
||||
CallProcess "$@"
|
||||
}
|
||||
|
||||
CallFlyele()
|
||||
{
|
||||
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 "$@"
|
||||
}
|
||||
|
||||
CallZhuMu()
|
||||
{
|
||||
#change current dir to excute path
|
||||
@@ -212,6 +232,7 @@ CallQQ()
|
||||
CallProcess "$@"
|
||||
}
|
||||
|
||||
|
||||
CallTIM()
|
||||
{
|
||||
if [ ! -f "$WINEPREFIX/../.QQ_run" ]; then
|
||||
@@ -387,9 +408,14 @@ CallPsCs6()
|
||||
CallProcess "$@"
|
||||
}
|
||||
|
||||
#####专属优化段结束
|
||||
|
||||
#arg 1: exec file path
|
||||
#arg 2: autostart ,or exec arg 1
|
||||
#arg 3: exec arg 2
|
||||
|
||||
|
||||
#### CallApp段,根据容器名找专属优化,没有就走通用启动
|
||||
CallApp()
|
||||
{
|
||||
FixLink
|
||||
@@ -456,6 +482,12 @@ CallApp()
|
||||
"Deepin-CS6")
|
||||
CallPsCs6 "$@"
|
||||
;;
|
||||
"Spark-flyele")
|
||||
CallFlyele "$@"
|
||||
;;
|
||||
"Spark-douyin")
|
||||
CallDouyin "$@"
|
||||
;;
|
||||
*)
|
||||
CallProcess "$@"
|
||||
;;
|
||||
@@ -501,7 +533,7 @@ UpdateApp()
|
||||
fi
|
||||
|
||||
case $BOTTLENAME in
|
||||
"Deepin-Intelligent" | "Deepin-QQ" | "Deepin-TIM" | "Deepin-WeChat" | "Deepin-WXWork" | "Deepin-Dding")
|
||||
"Deepin-Intelligent" | "Deepin-QQ" | "Deepin-TIM" | "Deepin-WeChat" | "Deepin-WXWork" | "Deepin-Dding" | "Wine-QQ" | "Spark-QQ" | "Spark-weixin")
|
||||
rm -rf "$WINEPREFIX"
|
||||
DeployApp
|
||||
return
|
||||
@@ -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^...\\...]//.. .. ........
|
||||
@@ -4,7 +4,7 @@ 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
|
||||
elif grep -Eqi "UnionTech" /etc/issue || grep -Eq "UnionTech" /etc/*-release; then
|
||||
DISTRO='UniontechOS'
|
||||
else
|
||||
DISTRO='OtherOS'
|
||||
@@ -13,13 +13,21 @@ Get_Dist_Name()
|
||||
#########<<<<<<<
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "无参数,无法启动。请参考set-dwine-scale.sh使用"
|
||||
echo "无参数,无法启动。这是一个set-wine-scale的组件,一般来说,你不会需要单独启动这个脚本"
|
||||
echo "请参考set-wine-scale.sh使用"
|
||||
echo "参数为CONTAINER_PATH"
|
||||
echo "只读取第一个,其他参数会被放弃"
|
||||
fi
|
||||
|
||||
CONTAINER_PATH="$1"
|
||||
|
||||
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
|
||||
|
||||
|
||||
mkdir -p $HOME/.config/spark-wine/
|
||||
#####全局参数位置
|
||||
#####能到这一步的说明已经是没有自定义参数了,直接读全局覆盖没问题
|
||||
@@ -57,11 +65,11 @@ scale_factor=`zenity --list \
|
||||
|
||||
case "$scale_factor" in
|
||||
"")
|
||||
zenity --info --text="默认为1倍缩放。您可以随时删除~/.config/spark-wine/scale.txt来重新设置" --width=500 --height=150
|
||||
zenity --info --text="默认为1倍缩放。您可以使用星火wine助手设置来重新设置" --width=500 --height=150
|
||||
scale_factor="1.0"
|
||||
;;
|
||||
*)
|
||||
zenity --info --text="缩放倍数为$scale_factor。已保存!您可以随时删除~/.config/spark-wine/scale.txt来重新设置" --width=500 --height=150
|
||||
zenity --info --text="缩放倍数为$scale_factor。已保存!您可以使用星火wine助手设置来重新设置" --width=500 --height=150
|
||||
;;
|
||||
esac
|
||||
echo "$scale_factor" > $HOME/.config/spark-wine/scale.txt
|
||||
@@ -7,14 +7,14 @@ help() {
|
||||
-s|--set-scale-factor 直接指定缩放。支持1.0,1.25,1.5,1.75,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,1.75,2.0
|
||||
path Wine Container directory path
|
||||
|
||||
|
||||
This script have super bunny power.
|
||||
EOF
|
||||
}
|
||||
#########################帮助文件结束#############################
|
||||
@@ -30,6 +30,13 @@ parse_args() {
|
||||
appointed_scale_factor="$2"
|
||||
|
||||
;;
|
||||
|
||||
"bunny")
|
||||
cat /opt/durapps/spark-dwine-helper/scale-set-helper/bunny.txt
|
||||
exit
|
||||
|
||||
;;
|
||||
|
||||
*)
|
||||
CONTAINER_PATH="$1"
|
||||
|
||||
@@ -43,8 +50,10 @@ parse_args "$@"
|
||||
|
||||
#####先看看PATH对不对
|
||||
if [ ! -f "$CONTAINER_PATH/user.reg" ];then
|
||||
echo "错误:找不到user.reg,退出。你应当在文件解压结束后调用此脚本"
|
||||
echo "错误:找不到user.reg,退出。你应当在文件解压结束后调用此脚本。"
|
||||
echo "如果你不清楚如何使用这个脚本,请使用 $0 -h"
|
||||
echo "E: Can not find user.reg. Exit. You should use this script after the extraction"
|
||||
echo "If you don't know how to use this script, try $0 -h"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -1,371 +0,0 @@
|
||||
#!/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>
|
||||
#
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
# 这是一个可以用于自定义的脚本,为了增加易读性,删除了大部分的case
|
||||
# 请对照spark_run_v4.sh进行操作
|
||||
# 建议把文件名中的custom换成你的app名字(不要中文),方便维护和识别
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
WINEPREFIX="$HOME/.deepinwine/@public_bottle_name@"
|
||||
APPDIR="/opt/deepinwine/apps/@public_bottle_name@"
|
||||
APPVER="@deb_version_string@"
|
||||
APPTAR="files.7z"
|
||||
BOTTLENAME=""
|
||||
WINE_CMD="deepin-wine"
|
||||
LOG_FILE=$0
|
||||
PUBLIC_DIR="/var/public"
|
||||
|
||||
SHELL_DIR=$(dirname $0)
|
||||
SHELL_DIR=$(realpath "$SHELL_DIR")
|
||||
if [ $SPECIFY_SHELL_DIR ]; then
|
||||
SHELL_DIR=$SPECIFY_SHELL_DIR
|
||||
fi
|
||||
|
||||
if [ $APPRUN_CMD ]; then
|
||||
WINE_CMD=$APPRUN_CMD
|
||||
fi
|
||||
|
||||
if [ $SPECIFY_SHELL_DIR ]; then
|
||||
SHELL_DIR=$SPECIFY_SHELL_DIR
|
||||
fi
|
||||
|
||||
|
||||
|
||||
_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()
|
||||
{
|
||||
echo "${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"
|
||||
}
|
||||
#############帮助文件
|
||||
FixLink()
|
||||
{
|
||||
if [ -d ${WINEPREFIX} ]; then
|
||||
CUR_DIR=$PWD
|
||||
cd "${WINEPREFIX}/dosdevices"
|
||||
rm c: z: y:
|
||||
ln -s -f ../drive_c c:
|
||||
ln -s -f / z:
|
||||
ln -s -f $HOME y:
|
||||
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}"
|
||||
}
|
||||
########如果有该文件夹则删除,然后再创建一个不允许写入的(这东西是被用在了QQ启动上,看来腾讯不怎么好对付)
|
||||
is_autostart()
|
||||
{
|
||||
AUTOSTART="/opt/deepinwine/tools/autostart"
|
||||
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
|
||||
}
|
||||
#########自动启动相关,等用到了再研究
|
||||
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 ];then
|
||||
$SHELL_DIR/kill.sh "$BOTTLENAME" block
|
||||
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
|
||||
|
||||
debug_log_to_file "Starting process $* ..."
|
||||
|
||||
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和自动启动(这个暂时没分析)的功能
|
||||
|
||||
|
||||
####请在这里把CustomAPP换成你的APP名字
|
||||
####非常不建议直接使用CustomAPP,将来维护你自己都不知道哪个脚本给谁用了
|
||||
####不要用中文
|
||||
CallCustomAPP()
|
||||
{
|
||||
###请在这里添加在CallProcess之前的脚本,即在启动应用前执行的。会在部署结束,启动应用前打开
|
||||
CallProcess "$@"
|
||||
}
|
||||
|
||||
#arg 1: exec file path
|
||||
#arg 2: autostart ,or exec arg 1
|
||||
#arg 3: exec arg 2
|
||||
CallApp()
|
||||
{
|
||||
FixLink
|
||||
debug_log "CallApp $BOTTLENAME arg count $#: $*"
|
||||
|
||||
case $BOTTLENAME in
|
||||
"User-Custom")
|
||||
#^---这里写你的容器名,就是解压到~/.deepinwine的那个文件夹名字
|
||||
CallCustomAPP "$@"
|
||||
#^---这里要和之前的那个对应
|
||||
;;
|
||||
*)
|
||||
CallProcess "$@"
|
||||
#仍然保留对未适配的APP的兼容
|
||||
;;
|
||||
esac
|
||||
}
|
||||
ExtractApp()
|
||||
{
|
||||
mkdir -p "$1"
|
||||
7z x "$APPDIR/$APPTAR" -o"$1"
|
||||
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 [ -f "$WINEPREFIX/PACKAGE_VERSION" ] && [ "$(cat "$WINEPREFIX/PACKAGE_VERSION")" = "$APPVER" ]; then
|
||||
return
|
||||
fi
|
||||
if [ -d "${WINEPREFIX}.tmpdir" ]; then
|
||||
rm -rf "${WINEPREFIX}.tmpdir"
|
||||
fi
|
||||
|
||||
case $BOTTLENAME in
|
||||
"Deepin-Intelligent" | "Deepin-QQ" | "Deepin-TIM" | "Deepin-WeChat" | "Deepin-WXWork" | "Deepin-Dding")
|
||||
rm -rf "$WINEPREFIX"
|
||||
DeployApp
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
ExtractApp "${WINEPREFIX}.tmpdir"
|
||||
$SHELL_DIR/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
|
||||
UpdateApp | progressbar "$BOTTLENAME" "更新$BOTTLENAME中..."
|
||||
else
|
||||
DeployApp | progressbar $BOTTLENAME "初始化$BOTTLENAME中..."
|
||||
fi
|
||||
############# WARNING: Here is the modified content: Now will run set-wine-scale.sh
|
||||
/opt/durapps/spark-dwine-helper/scale-set-helper/set-wine-scale.sh "$WINEPREFIX" "$WINEPREFIX"
|
||||
|
||||
CallApp "$@"
|
||||
}
|
||||
|
||||
CreateBottle()
|
||||
{
|
||||
if [ -d "$WINEPREFIX" ]; then
|
||||
UpdateApp
|
||||
else
|
||||
DeployApp
|
||||
fi
|
||||
}
|
||||
|
||||
ParseArgs()
|
||||
{
|
||||
if [ $# -eq 4 ];then
|
||||
RunApp "$3"
|
||||
elif [ $# -eq 5 ];then
|
||||
RunApp "$3" "$5"
|
||||
else
|
||||
RunApp "$3" "$5" "$6"
|
||||
fi
|
||||
}
|
||||
|
||||
init_log_file
|
||||
|
||||
# Check if some visual feedback is possible
|
||||
if command -v zenity >/dev/null 2>&1; then
|
||||
progressbar()
|
||||
{
|
||||
WINDOWID="" zenity --progress --title="$1" --text="$2" --pulsate --width=400 --auto-close --no-cancel ||
|
||||
WINDOWID="" zenity --progress --title="$1" --text="$2" --pulsate --width=400 --auto-close
|
||||
}
|
||||
|
||||
else
|
||||
progressbar()
|
||||
{
|
||||
cat -
|
||||
}
|
||||
fi
|
||||
|
||||
if [ $# -lt 3 ]; then
|
||||
debug_log "参数个数小于3个"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#####准备启动进程,分析在 https://shenmo7192.gitee.io/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/
|
||||
|
||||
BOTTLENAME="$1"
|
||||
WINEPREFIX="$HOME/.deepinwine/$1"
|
||||
|
||||
|
||||
|
||||
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
|
||||
;;
|
||||
"-c" | "--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
|
||||
@@ -20,7 +20,7 @@ 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
|
||||
elif grep -Eqi "UnionTech" /etc/issue || grep -Eq "UnionTech" /etc/*-release; then
|
||||
DISTRO='UniontechOS'
|
||||
else
|
||||
DISTRO='OtherOS'
|
||||
|
||||
Reference in New Issue
Block a user