From 168f8c4d100defc273b5c0c2ce993a0afaf03523 Mon Sep 17 00:00:00 2001
From: castro-fidel <tergoevm@gmail.com>
Date: Mon, 24 Jan 2022 20:32:48 +0300
Subject: [PATCH] ###Scripts version 2070###

---
 data_from_portwine/changelog_eng              |  5 +++
 data_from_portwine/changelog_rus              | 15 ++++----
 data_from_portwine/scripts/functions_helper   | 12 ++++--
 .../scripts/portwine_db/AC4BFSP               |  2 +-
 .../scripts/portwine_db/Cinebench             |  2 +-
 .../scripts/portwine_db/Deponia               |  2 +-
 .../scripts/portwine_db/MassEffectLauncher    |  2 +-
 data_from_portwine/scripts/portwine_db/ePSXe  |  2 +-
 data_from_portwine/scripts/portwine_db/eve    |  2 +-
 data_from_portwine/scripts/portwine_db/itch   |  2 +-
 .../scripts/portwine_db/sanitarium_XP         |  2 +-
 data_from_portwine/scripts/portwine_db/steam  |  2 +-
 data_from_portwine/scripts/runlib             |  4 +-
 data_from_portwine/scripts/start.sh           | 37 +++++++++++++------
 data_from_portwine/scripts/var                |  4 +-
 15 files changed, 60 insertions(+), 35 deletions(-)

diff --git a/data_from_portwine/changelog_eng b/data_from_portwine/changelog_eng
index 36e8ea14..1c47882f 100644
--- a/data_from_portwine/changelog_eng
+++ b/data_from_portwine/changelog_eng
@@ -2,6 +2,11 @@ You can help us in the development of the project on the website: https://boosty
 -----------------------------------------
 Changelog:
 
+###Scripts version 2070###
+* added PW_D3D_EXTRAS_DISABLE variable to EDIT_DB for DirectX external library
+* rollback MANGOHUD to stable version from libs_v19.2
+* fixed internet download interruption
+
 ###Scripts version 2069###
 * added support for OpenSUSE (vkBasalt and MANGOHUD)
 * fixed GOG installation (for OpenSUSE and Fedora)
diff --git a/data_from_portwine/changelog_rus b/data_from_portwine/changelog_rus
index e8e92068..01b3439e 100755
--- a/data_from_portwine/changelog_rus
+++ b/data_from_portwine/changelog_rus
@@ -1,11 +1,12 @@
-История изменений и дальнейшие планы:
------------------------------------------
-В планах: 
-* wget заменить на curl
-* добавить выбор и создание различных префиксов (с его наполнением)
-* добавить выбор языка в PortProton и about us
-* заниматься только развитием проекта за счет вашей подписки на https://boosty.to/portwine-linux.ru
+Вы можете помочь развитию проекта: https://portwine-linux.ru/donate/
 -----------------------------------------
+История изменений:
+
+###Scripts version 2070###
+* добавлена переменная PW_D3D_EXTRAS_DISABLE в EDIT_DB для возможности отключения сторонних библиотек DirectX
+* откат MANGOHUD до стабильной версии из libs_v19.2
+* исправлено прерывание загрузки из интернета
+
 ###Scripts version 2069###
 * добавлена поддержка OpenSUSE (vkBasalt и MANGOHUD)
 * исправлена установка GOG (для OpenSUSE и Fedora)
diff --git a/data_from_portwine/scripts/functions_helper b/data_from_portwine/scripts/functions_helper
index 862a2ad5..c00fc552 100755
--- a/data_from_portwine/scripts/functions_helper
+++ b/data_from_portwine/scripts/functions_helper
@@ -160,7 +160,11 @@ try_download_silent () {
 
 zenity_error_download () {
     `zenity --error --title "Error..." --text "You will need to check internet connection,\nand press OK for repeat download" --no-wrap `
-    [ "$?" != 0 ] && exit 1 || return 0
+    if [[ "$?" != 0 ]] ; then
+        stop_portwine
+    else
+        return 0
+    fi
 }
 
 create_new_dir () {
@@ -404,8 +408,8 @@ pw_start_progress_bar_block () {
 }
 
 pw_stop_progress_bar () {
-    kill -s SIGUSR1 "$PW_YAD_PID_PROGRESS_BAR_BLOCK" "$PW_YAD_PID_PROGRESS_BAR_CS" > /dev/null 2>&1
-    kill -s SIGUSR1 "$PW_YAD_PID_PFX_COVER_UI" "$PW_YAD_PID_PROGRESS_BAR_COVER" > /dev/null 2>&1
+    kill -s SIGUSR1 "$PW_YAD_PID_PROGRESS_BAR_BLOCK" "$PW_YAD_PID_PROGRESS_BAR_CS" "$PW_YAD_PID_PFX_COVER_UI" \
+    "$PW_YAD_PID_PROGRESS_BAR_COVER" > /dev/null 2>&1
     return 0
 }
 export -f pw_stop_progress_bar
@@ -480,7 +484,7 @@ stop_portwine () {
         kill -s SIGUSR1 "`pgrep -a yad_new | grep "\-\-notification" | awk '{print $1}'`"
     fi
     add_in_stop_portwine > /dev/null 2>&1
-    kill -n 9 `pgrep -a start.sh | grep '/PortProton/' | awk '{print $1}'` > /dev/null 2>&1
+    kill -n 9 `pgrep -a start.sh | grep -i '/PortProton/' | awk '{print $1}'` > /dev/null 2>&1
     exit 0
 }
 export -f stop_portwine
diff --git a/data_from_portwine/scripts/portwine_db/AC4BFSP b/data_from_portwine/scripts/portwine_db/AC4BFSP
index fd78b040..6b4701da 100644
--- a/data_from_portwine/scripts/portwine_db/AC4BFSP
+++ b/data_from_portwine/scripts/portwine_db/AC4BFSP
@@ -8,7 +8,7 @@
 ##export PW_DLL_INSTALL="vcrun2017"               # Install DDL in port prefix (used winetricks) 
 ##export WINEDLLOVERRIDES="blabla=n,b"
 ##export LAUNCH_PARAMETERS="('"+com_skipIntroVideo 1"' '"+com_skipSignInManager 1"')"                # Additional launch options
-export PW_WINE_USE=PROTON_STEAM_6.3-8
+export PW_WINE_USE=PROTON_GE
 export PW_VULKAN_USE=1
 export PW_USE_DXR10=0
 ##export PW_DLSS_ON=1
diff --git a/data_from_portwine/scripts/portwine_db/Cinebench b/data_from_portwine/scripts/portwine_db/Cinebench
index ff2475c9..0b971e92 100755
--- a/data_from_portwine/scripts/portwine_db/Cinebench
+++ b/data_from_portwine/scripts/portwine_db/Cinebench
@@ -8,7 +8,7 @@
 ##export PW_DLL_INSTALL="vcrun2017"               # Install DDL in port prefix (used winetricks) 
 ##export WINEDLLOVERRIDES="blabla=n,b"
 ##export LAUNCH_PARAMETERS="('"+com_skipIntroVideo 1"' '"+com_skipSignInManager 1"')"                # Additional launch options
-export PW_WINE_USE=PROTON_STEAM_6.3-8C_PW2
+export PW_WINE_USE=PROTON_GEC_PW2
 export PW_VULKAN_USE=1
 ##export PW_DXR_ON=1
 ##export PW_VULKAN_NO_ASYNC=1                     # Disabled ASYNC for VULKAN
diff --git a/data_from_portwine/scripts/portwine_db/Deponia b/data_from_portwine/scripts/portwine_db/Deponia
index f8c2704d..1efaa952 100644
--- a/data_from_portwine/scripts/portwine_db/Deponia
+++ b/data_from_portwine/scripts/portwine_db/Deponia
@@ -8,7 +8,7 @@
 ##export PW_DLL_INSTALL="vcrun2017"               # Install DDL in port prefix (used winetricks) 
 ##export WINEDLLOVERRIDES="blabla=n,b"
 ##export LAUNCH_PARAMETERS="('"+com_skipIntroVideo 1"' '"+com_skipSignInManager 1"')"                # Additional launch options
-export PW_WINE_USE=PROTON_STEAM_6.3-8C_PW2
+export PW_WINE_USE=PROTON_GEC_PW2
 export PW_VULKAN_USE=0
 ##export PW_USE_DXR10=1
 ##export PW_DLSS_ON=1
diff --git a/data_from_portwine/scripts/portwine_db/MassEffectLauncher b/data_from_portwine/scripts/portwine_db/MassEffectLauncher
index 9e430977..d987a081 100644
--- a/data_from_portwine/scripts/portwine_db/MassEffectLauncher
+++ b/data_from_portwine/scripts/portwine_db/MassEffectLauncher
@@ -8,7 +8,7 @@
 ##export PW_DLL_INSTALL="vcrun2017"               # Install DDL in port prefix (used winetricks) 
 ##export WINEDLLOVERRIDES="blabla=n,b"
 ##export LAUNCH_PARAMETERS="('"+com_skipIntroVideo 1"' '"+com_skipSignInManager 1"')"                # Additional launch options
-export PW_WINE_USE=PROTON_STEAM_6.3-8
+export PW_WINE_USE=PROTON_GE
 export PW_VULKAN_USE=1
 export PW_DXR_ON=0
 ##export PW_DLSS_ON=1
diff --git a/data_from_portwine/scripts/portwine_db/ePSXe b/data_from_portwine/scripts/portwine_db/ePSXe
index 377a3e4a..dea78bd8 100644
--- a/data_from_portwine/scripts/portwine_db/ePSXe
+++ b/data_from_portwine/scripts/portwine_db/ePSXe
@@ -8,7 +8,7 @@
 ##export PW_DLL_INSTALL="vcrun2017"               # Install DDL in port prefix (used winetricks) 
 ##export WINEDLLOVERRIDES="blabla=n,b"
 ##export LAUNCH_PARAMETERS="('"+com_skipIntroVideo 1"' '"+com_skipSignInManager 1"')"                # Additional launch options
-export PW_WINE_USE=PROTON_STEAM_6.3-8
+export PW_WINE_USE=PROTON_GE
 export PW_VULKAN_USE=1
 ##export PW_USE_DXR10=1
 ##export PW_DLSS_ON=1
diff --git a/data_from_portwine/scripts/portwine_db/eve b/data_from_portwine/scripts/portwine_db/eve
index 1cd19436..b641f5b7 100755
--- a/data_from_portwine/scripts/portwine_db/eve
+++ b/data_from_portwine/scripts/portwine_db/eve
@@ -5,7 +5,7 @@
 #Rating=5
 #####################examples###########################
 ##export PW_COMMENT_DB="blablabla"
-export PW_WINE_USE=PROTON_STEAM
+export PW_WINE_USE=PROTON_GE
 export PW_VULKAN_USE=1
 #export PW_WINDOWS_VER=7                        # Set windows version 10, 7 or XP
 export PW_DLL_INSTALL="vcrun2019 d3dcompiler_47"               # Install DDL in port prefix (used winetricks) 
diff --git a/data_from_portwine/scripts/portwine_db/itch b/data_from_portwine/scripts/portwine_db/itch
index 3f3bc91a..527919c2 100644
--- a/data_from_portwine/scripts/portwine_db/itch
+++ b/data_from_portwine/scripts/portwine_db/itch
@@ -8,7 +8,7 @@
 ##export PW_DLL_INSTALL="vcrun2017"               # Install DDL in port prefix (used winetricks) 
 ##export WINEDLLOVERRIDES="blabla=n,b"
 ##export LAUNCH_PARAMETERS="('"+com_skipIntroVideo 1"' '"+com_skipSignInManager 1"')"                # Additional launch options
-export PW_WINE_USE=PROTON_STEAM_6.3-7
+export PW_WINE_USE=PROTON_GE
 export PW_VULKAN_USE=1
 ##export PW_USE_DXR10=1
 ##export PW_DLSS_ON=1
diff --git a/data_from_portwine/scripts/portwine_db/sanitarium_XP b/data_from_portwine/scripts/portwine_db/sanitarium_XP
index 214ea68b..f860ed03 100644
--- a/data_from_portwine/scripts/portwine_db/sanitarium_XP
+++ b/data_from_portwine/scripts/portwine_db/sanitarium_XP
@@ -8,7 +8,7 @@
 ##export PW_DLL_INSTALL="vcrun2017"               # Install DDL in port prefix (used winetricks) 
 ##export WINEDLLOVERRIDES="blabla=n,b"
 ##export LAUNCH_PARAMETERS="('"+com_skipIntroVideo 1"' '"+com_skipSignInManager 1"')"                # Additional launch options
-export PW_WINE_USE=PROTON_STEAM_6.3-8C_PW2
+export PW_WINE_USE=PROTON_GEC_PW2
 export PW_VULKAN_USE=0
 ##export PW_USE_DXR10=1
 ##export PW_DLSS_ON=1
diff --git a/data_from_portwine/scripts/portwine_db/steam b/data_from_portwine/scripts/portwine_db/steam
index e7e9261a..c45db17f 100755
--- a/data_from_portwine/scripts/portwine_db/steam
+++ b/data_from_portwine/scripts/portwine_db/steam
@@ -4,7 +4,7 @@
 #Rating=5
 ################################################
 export PW_COMMENT_DB="Steam"
-export PW_WINDOWS_VER=10                        # Set windows version 10, 7 or XP
+export PW_WINDOWS_VER=7                        # Set windows version 10, 7 or XP
 export PW_DLL_INSTALL="vcrun2019 d3dcompiler_46"
 export WINEDLLOVERRIDES="libglesv2,lsteamclient="
 export LAUNCH_PARAMETERS="-no-cef-sandbox"
diff --git a/data_from_portwine/scripts/runlib b/data_from_portwine/scripts/runlib
index e5223272..139c90d9 100755
--- a/data_from_portwine/scripts/runlib
+++ b/data_from_portwine/scripts/runlib
@@ -344,7 +344,9 @@ start_portwine () {
     do  
         try_force_link_file "${PW_PLUGINS_PATH}/d3d_extras/x64/${d3d_extras_from_plugins}.dll" "${WINEPREFIX}/drive_c/windows/system32/"
         try_force_link_file "${PW_PLUGINS_PATH}/d3d_extras/x32/${d3d_extras_from_plugins}.dll" "${WINEPREFIX}/drive_c/windows/syswow64/"
-        var_winedlloverride_update "${d3d_extras_from_plugins}=n"
+        if [[ "${PW_D3D_EXTRAS_DISABLE}" != 1 ]] ; then
+            var_winedlloverride_update "${d3d_extras_from_plugins}=n"
+        fi
         if [[ -z "`grep "${d3d_extras_from_plugins}" "${WINEPREFIX}/winetricks.log"`" ]] ; then
             echo "${d3d_extras_from_plugins}" >> "${WINEPREFIX}/winetricks.log"
         fi
diff --git a/data_from_portwine/scripts/start.sh b/data_from_portwine/scripts/start.sh
index fce87db9..0d25dac5 100755
--- a/data_from_portwine/scripts/start.sh
+++ b/data_from_portwine/scripts/start.sh
@@ -239,7 +239,8 @@ pw_edit_db () {
     pw_gui_for_edit_db PW_MANGOHUD PW_MANGOHUD_USER_CONF ENABLE_VKBASALT PW_NO_ESYNC PW_NO_FSYNC PW_USE_DXR10 PW_USE_DXR11 \
     PW_VULKAN_NO_ASYNC PW_USE_NVAPI_AND_DLSS PW_OLD_GL_STRING PW_HIDE_NVIDIA_GPU PW_FORCE_USE_VSYNC PW_VIRTUAL_DESKTOP \
     PW_WINEDBG_DISABLE PW_USE_TERMINAL PW_WINE_ALLOW_XIM PW_HEAP_DELAY_FREE PW_NO_WRITE_WATCH PW_GUI_DISABLED_CS \
-    PW_USE_GSTREAMER PW_USE_RUNTIME PW_USE_GAMEMODE PW_DX12_DISABLE PW_USE_WINE_DXGI PW_PRIME_RENDER_OFFLOAD
+    PW_USE_GSTREAMER PW_USE_RUNTIME PW_USE_GAMEMODE PW_DX12_DISABLE PW_USE_WINE_DXGI PW_PRIME_RENDER_OFFLOAD \
+    PW_D3D_EXTRAS_DISABLE
     if [ "$?" == 0 ] ; then
         /bin/bash -c ${pw_full_command_line[*]} &
         exit 0
@@ -276,21 +277,25 @@ if [ ! -z "${PORTWINE_DB_FILE}" ] ; then
     if [[ -z "${PW_VULKAN_USE}" || -z "${PW_WINE_USE}" ]] ; then
         unset PW_GUI_DISABLED_CS
         [ -z "${PW_VULKAN_USE}" ] && export PW_VULKAN_USE=1
-        # [ -z "${PW_WINE_USE}" ] && export PW_WINE_USE=${PW_PROTON_STEAM_VER}
     fi
     case "${PW_VULKAN_USE}" in
             "0") export PW_DEFAULT_VULKAN_USE='OPENGL !VULKAN (DXVK and VKD3D)' ;;
               *) export PW_DEFAULT_VULKAN_USE='VULKAN (DXVK and VKD3D)!OPENGL ' ;;
     esac
-    case "${PW_WINE_USE}" in
-        "${PW_PROTON_GE_VER}") 
-            export PW_DEFAULT_WINE_USE="${PW_PROTON_GE_VER}!${PW_PROTON_STEAM_VER}${DIST_ADD_TO_GUI}" ;;
-        "${PW_PROTON_STEAM_VER}") 
-            export PW_DEFAULT_WINE_USE="${PW_PROTON_STEAM_VER}!${PW_PROTON_GE_VER}${DIST_ADD_TO_GUI}" ;;
-        *)
+    if [[ ! -z `echo "${PW_WINE_USE}" | grep "^PROTON_STEAM$"` ]] ; then
+        export PW_DEFAULT_WINE_USE="${PW_PROTON_STEAM_VER}!${PW_PROTON_GE_VER}${DIST_ADD_TO_GUI}"
+    elif [[ ! -z `echo "${PW_WINE_USE}" | grep "^PROTON_GE$"` ]] ; then
+        export PW_DEFAULT_WINE_USE="${PW_PROTON_GE_VER}!${PW_PROTON_STEAM_VER}${DIST_ADD_TO_GUI}"
+    else
+        if [[ "${PW_WINE_USE}" == "${PW_PROTON_STEAM_VER}" ]] ; then
+            export PW_DEFAULT_WINE_USE="${PW_WINE_USE}!${PW_PROTON_GE_VER}${DIST_ADD_TO_GUI}" 
+        elif [[ "${PW_WINE_USE}" == "${PW_PROTON_GE_VER}" ]] ; then
+            export PW_DEFAULT_WINE_USE="${PW_WINE_USE}!${PW_PROTON_STEAM_VER}${DIST_ADD_TO_GUI}" 
+        else
             export DIST_ADD_TO_GUI=`echo ${DIST_ADD_TO_GUI} | sed -e s/"\!${PW_WINE_USE}$//g"`
-            export PW_DEFAULT_WINE_USE="${PW_WINE_USE}!${PW_PROTON_STEAM_VER}!${PW_PROTON_GE_VER}${DIST_ADD_TO_GUI}" ;;
-    esac
+            export PW_DEFAULT_WINE_USE="${PW_WINE_USE}!${PW_PROTON_GE_VER}!${PW_PROTON_STEAM_VER}${DIST_ADD_TO_GUI}"
+        fi
+    fi
 else
     export PW_DEFAULT_VULKAN_USE='VULKAN (DXVK and VKD3D)!OPENGL '
     if [[ ! -z `echo "${PW_WINE_USE}" | grep "^PROTON_STEAM$"` ]] ; then
@@ -298,7 +303,14 @@ else
     elif [[ ! -z `echo "${PW_WINE_USE}" | grep "^PROTON_GE$"` ]] ; then
         export PW_DEFAULT_WINE_USE="${PW_PROTON_GE_VER}!${PW_PROTON_STEAM_VER}${DIST_ADD_TO_GUI}"
     else
-        export PW_DEFAULT_WINE_USE="${PW_WINE_USE}!${PW_PROTON_GE_VER}!${PW_PROTON_STEAM_VER}${DIST_ADD_TO_GUI}"       
+        if [[ "${PW_WINE_USE}" == "${PW_PROTON_STEAM_VER}" ]] ; then
+            export PW_DEFAULT_WINE_USE="${PW_WINE_USE}!${PW_PROTON_GE_VER}${DIST_ADD_TO_GUI}" 
+        elif [[ "${PW_WINE_USE}" == "${PW_PROTON_GE_VER}" ]] ; then
+            export PW_DEFAULT_WINE_USE="${PW_WINE_USE}!${PW_PROTON_STEAM_VER}${DIST_ADD_TO_GUI}" 
+        else
+            export DIST_ADD_TO_GUI=`echo ${DIST_ADD_TO_GUI} | sed -e s/"\!${PW_WINE_USE}$//g"`
+            export PW_DEFAULT_WINE_USE="${PW_WINE_USE}!${PW_PROTON_GE_VER}!${PW_PROTON_STEAM_VER}${DIST_ADD_TO_GUI}"
+        fi     
     fi
     unset PW_GUI_DISABLED_CS
 fi
@@ -405,12 +417,13 @@ else
     --field="   Rockstar Games Launcher"!"$PW_GUI_ICON_PATH/Rockstar.png":"BTN" '@bash -c "button_click PW_ROCKSTAR"' \
     --field="   My.Games Launcher"!"$PW_GUI_ICON_PATH/mygames.png":"BTN" '@bash -c "button_click PW_MYGAMES"' \
     --field="   OSU"!"$PW_GUI_ICON_PATH/osu.png":"BTN" '@bash -c "button_click PW_OSU"' \
-    --field="   Glyph Client"!"$PW_GUI_ICON_PATH/glyph.png":"BTN" '@bash -c "button_click  PW_GLYPH"' \
     --field="   Ankama Launcher"!"$PW_GUI_ICON_PATH/ankama.png":"BTN" '@bash -c "button_click PW_ANKAMA"' \
     --field="   League of Legends"!"$PW_GUI_ICON_PATH/lol.png":"BTN" '@bash -c "button_click PW_LOL"' \
     --field="   Gameforge Client"!"$PW_GUI_ICON_PATH/gameforge.png":"BTN" '@bash -c "button_click  PW_GAMEFORGE"' \
     --field="   ITCH.IO"!"$PW_GUI_ICON_PATH/itch.png":"BTN" '@bash -c "button_click PW_ITCH"' & 
 
+    # --field="   Glyph Client"!"$PW_GUI_ICON_PATH/glyph.png":"BTN" '@bash -c "button_click  PW_GLYPH"' \
+
     "${pw_yad}" --plug=${KEY} --tabnum=1 --columns=3 --form --separator=";" \
     --image "$PW_GUI_ICON_PATH/port_proton.png" \
     --field=":CB" "VULKAN (DXVK and VKD3D)!OPENGL" \
diff --git a/data_from_portwine/scripts/var b/data_from_portwine/scripts/var
index fb8abc70..0b43d00d 100755
--- a/data_from_portwine/scripts/var
+++ b/data_from_portwine/scripts/var
@@ -1,6 +1,6 @@
 #!/bin/bash
 #Author: Castro-Fidel (PortWINE-Linux.ru)
-#SCRIPTS_NEXT_VERSION=2069
+#SCRIPTS_NEXT_VERSION=2070
 #PORT_NEXT_VERSION=97
 ########################################################################
 export PW_MANGOHUD=1
@@ -25,7 +25,7 @@ export PW_MUST_HAVE_DLL="physx mfc42 vcrun2019"
 export PW_WINEDBG_DISABLE=1
 export PW_WINDOWS_VER="10"
 export WINEARCH="win64"
-export PW_LIBS_VER="_v20"
+export PW_LIBS_VER="_v21"
 export PORTWINE_URL="http://portwine-linux.ru/"
 export GDK_BACKEND="x11"
 export PW_USE_GSTREAMER="1"