跟随上游

Signed-off-by: shenmo <jifengshenmo@outlook.com>
This commit is contained in:
2024-01-22 10:13:23 +00:00
committed by Gitee
parent f6740f1adc
commit 7facfd4355

View File

@@ -13,9 +13,10 @@
source /opt/durapps/transhell/transhell.sh source /opt/durapps/transhell/transhell.sh
load_transhell_debug load_transhell_debug
WINEPREFIX="$HOME/.deepinwine/@public_bottle_name@" BOTTLENAME="$1"
APPDIR="/opt/deepinwine/apps/@public_bottle_name@" WINEPREFIX="$HOME/.deepinwine/$1"
APPVER="@deb_version_string@" APPDIR="/opt/apps/${DEB_PACKAGE_NAME}/files"
APPVER=""
APPTAR="files.7z" APPTAR="files.7z"
BOTTLENAME="" BOTTLENAME=""
WINE_CMD="deepin-wine" WINE_CMD="deepin-wine"
@@ -91,11 +92,39 @@ HelpApp()
echo " -h/--help Show program help info" 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() FixLink()
{ {
if [ -d ${WINEPREFIX} ]; then if [ -d ${WINEPREFIX} ]; then
CUR_DIR=$PWD CUR_DIR=$PWD
cd "${WINEPREFIX}/dosdevices" cd "${WINEPREFIX}/dosdevices"
# 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
rm c: z: y: rm c: z: y:
ln -s -f ../drive_c c: ln -s -f ../drive_c c:
ln -s -f / z: ln -s -f / z:
@@ -115,7 +144,7 @@ DisableWrite()
mkdir "${1}" mkdir "${1}"
chmod -w "${1}" chmod -w "${1}"
} }
########如果有该文件夹则删除,然后再创建一个不允许写入的这东西是被用在了QQ启动上看来腾讯不怎么好对付 ########如果有该文件夹则删除,然后再创建一个不允许写入的
is_autostart() is_autostart()
{ {
AUTOSTART="/opt/deepinwine/tools/autostart" AUTOSTART="/opt/deepinwine/tools/autostart"
@@ -146,7 +175,7 @@ CallProcess()
#kill bloack process #kill bloack process
is_autostart $DEB_PACKAGE_NAME is_autostart $DEB_PACKAGE_NAME
autostart=$? autostart=$?
if [ $autostart -ne 0 ];then if [[ $autostart -ne 0 ]] && [[ "$1" != *"pluginloader.exe" ]];then
$SHELL_DIR/spark_kill.sh "$BOTTLENAME" block $SHELL_DIR/spark_kill.sh "$BOTTLENAME" block
fi fi
@@ -161,14 +190,7 @@ CallProcess()
fi fi
# Disable winemenubuilder # Disable winemenubuilder
env WINEPREFIX="$WINEPREFIX" $WINE_CMD reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v winemenubuilder.exe /f env WINEPREFIX="$WINEPREFIX" $WINE_CMD reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v winemenubuilder.exe /f
# 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
@@ -239,7 +261,7 @@ local tmp_log=$(mktemp)
sleep 1 sleep 1
done)| zenity --progress --title="$BOTTLENAME" --text="${TRANSHELL_CONTENT_UNPACKING} $BOTTLENAME..." --width=400 --auto-close --no-cancel done)| zenity --progress --title="$BOTTLENAME" --text="${TRANSHELL_CONTENT_UNPACKING} $BOTTLENAME..." --width=400 --auto-close --no-cancel
rm $tmp_log
mv "$1/drive_c/users/@current_user@" "$1/drive_c/users/$USER" mv "$1/drive_c/users/@current_user@" "$1/drive_c/users/$USER"
sed -i "s#@current_user@#$USER#" $1/*.reg sed -i "s#@current_user@#$USER#" $1/*.reg
@@ -377,7 +399,7 @@ case $4 in
"-r" | "--reset") "-r" | "--reset")
ResetApp ResetApp
;; ;;
"-c" | "--create") "-cb" | "--create")
CreateBottle CreateBottle
;; ;;
"-e" | "--remove") "-e" | "--remove")
@@ -398,4 +420,4 @@ case $4 in
exit 1 exit 1
;; ;;
esac esac
exit 0 exit 0