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 901f1b3494f771e777d00dbd928cbf6a31f13464..05a6c8205195cc70ba1562b0080fb14b86f3afe7 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 +##############>>>>>>>>> + #########################执行段