From ac3caf46ac42f323c03b0df2d35ca7963823065e Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Sat, 3 Aug 2024 08:06:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8C=85=E7=94=A8=E4=BE=8B=E5=8A=A0?= =?UTF-8?q?=E5=85=A5wine=E8=87=AA=E8=A7=A3=E5=8E=8B=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../run.sh" | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git "a/\346\211\223\345\214\205\347\224\250\344\276\213/run.sh" "b/\346\211\223\345\214\205\347\224\250\344\276\213/run.sh" index 901f1b3..05a6c82 100755 --- "a/\346\211\223\345\214\205\347\224\250\344\276\213/run.sh" +++ "b/\346\211\223\345\214\205\347\224\250\344\276\213/run.sh" @@ -16,6 +16,32 @@ #######################函数段。下文调用的额外功能会在此处声明 +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 @@ -103,6 +129,14 @@ export WINEDLLOVERRIDES="control.exe=d" 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 +##############>>>>>>>>> + #########################执行段 -- Gitee