打包用例加入wine自解压支持

This commit is contained in:
2024-08-03 08:06:38 +08:00
parent 03704b2692
commit ac3caf46ac

View File

@@ -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
##############>>>>>>>>>
#########################执行段