Commit aae3bd7c authored by Mikhail Tergoev's avatar Mikhail Tergoev

Add wineserver-k and wineboot -r to runlib. Fix DXVK uninstall

parent d352f4e1
...@@ -56,14 +56,22 @@ export PATH_OLD="$PATH" ...@@ -56,14 +56,22 @@ export PATH_OLD="$PATH"
. "${link}"/lang . "${link}"/lang
######################################################################## ########################################################################
GLIBC_REQUIRED=2.23 GLIBC_REQUIRED=2.27
GLIBC_VERSION="$(ldd --version | head -n1 | sed 's/\(.*\) //g' | sed 's/\.[^.]*//2g')" GLIBC_VERSION="$(ldd --version | head -n1 | sed 's/\(.*\) //g' | sed 's/\.[^.]*//2g')"
if [ "$(echo ${GLIBC_VERSION} | sed 's/\.//g')" -lt "$(echo ${GLIBC_REQUIRED} | sed 's/\.//g')" ] if [ "$(echo ${GLIBC_VERSION} | sed 's/\.//g')" -lt "$(echo ${GLIBC_REQUIRED} | sed 's/\.//g')" ]
then then
WINEDIR="${PORT_WINE_PATH}"/data/wine_glibc_223 WINEDIR="${PORT_WINE_PATH}"/data/wine_glibc_223
if [ -d "${PORT_WINE_PATH}/data/wine_glibc_227" ]
then
rm -fr "${PORT_WINE_PATH}"/data/wine_glibc_227
fi
else else
WINEDIR="${PORT_WINE_PATH}"/data/wine_glibc_227 WINEDIR="${PORT_WINE_PATH}"/data/wine_glibc_227
if [ -d "${PORT_WINE_PATH}/data/wine_glibc_223" ]
then
rm -fr "${PORT_WINE_PATH}"/data/wine_glibc_223
fi
fi fi
echo "Used WINE: ${WINEDIR}" echo "Used WINE: ${WINEDIR}"
######################################################################## ########################################################################
...@@ -131,6 +139,8 @@ fi ...@@ -131,6 +139,8 @@ fi
# export WINEESYNC=1 # export WINEESYNC=1
# fi # fi
#fi #fi
${WINESERVER} -k
######################################################################## ########################################################################
START_PORTWINE () START_PORTWINE ()
...@@ -181,6 +191,7 @@ done ...@@ -181,6 +191,7 @@ done
echo disable > "$WINEPREFIX/.update-timestamp" echo disable > "$WINEPREFIX/.update-timestamp"
ADD_IN_START_PORTWINE ADD_IN_START_PORTWINE
${WINEBOOT} -r
} }
######################################################################## ########################################################################
...@@ -188,7 +199,7 @@ OPENGL_SET () ...@@ -188,7 +199,7 @@ OPENGL_SET ()
{ {
if [ -e "${config_path}/dxvk" ] if [ -e "${config_path}/dxvk" ]
then then
bash "${link}/setup_dxvk.sh" "uninstall" sh "${link}/setup_dxvk.sh" "uninstall"
rm -f "${config_path}/dxvk" rm -f "${config_path}/dxvk"
else else
echo "DXVK is disabled" echo "DXVK is disabled"
...@@ -199,6 +210,13 @@ export DXVK_STATE_CACHE=0 ...@@ -199,6 +210,13 @@ export DXVK_STATE_CACHE=0
export __GL_SHADER_DISK_CACHE_PATH="${PATH_TO_GAME}" export __GL_SHADER_DISK_CACHE_PATH="${PATH_TO_GAME}"
export __GL_SHADER_DISK_CACHE=1 export __GL_SHADER_DISK_CACHE=1
export mesa_glthread="true" export mesa_glthread="true"
if [ -x "`which nvidia-settings 2>/dev/null`" ]
then
export LD_PRELOAD="libpthread.so.0 libGL.so.1"
export __GL_THREADED_OPTIMIZATIONS=1
fi
} }
######################################################################## ########################################################################
......
#!/bin/bash
# figure out where we are
basedir=`dirname "$(readlink -f $0)"`
# figure out which action to perform
action="$1"
case "$action" in
install)
;;
uninstall)
;;
*)
echo "Unrecognized action: $action"
echo "Usage: $0 [install|uninstall] [--without-dxgi] [--symlink]"
exit 1
esac
# process arguments
shift
with_dxgi=1
file_cmd="cp"
while [ $# -gt 0 ]; do
case "$1" in
"--without-dxgi")
with_dxgi=0
;;
"--symlink")
file_cmd="ln -s"
;;
esac
shift
done
# check wine prefix before invoking wine, so that we
# don't accidentally create one if the user screws up
if [ -n "$WINEPREFIX" ] && ! [ -f "$WINEPREFIX/system.reg" ]; then
echo "$WINEPREFIX:"' Not a valid wine prefix.' >&2
exit 1
fi
# find wine executable
export WINEDEBUG=-all
if [ -z "$wine" ]; then
wine="wine"
fi
wine64="${wine}64"
wineboot="${wine}boot"
# resolve 32-bit and 64-bit system32 path
winever=`$wine --version | grep wine`
if [ -z "$winever" ]; then
echo "$wine:"' Not a wine executable. Check your $wine.' >&2
exit 1
fi
# ensure wine placeholder dlls are recreated
# if they are missing
$wineboot -u
win32_sys_path=$($wine winepath -u 'C:\windows\system32' 2> /dev/null)
win64_sys_path=$($wine64 winepath -u 'C:\windows\system32' 2> /dev/null)
if [ -z "$win32_sys_path" ] && [ -z "$win64_sys_path" ]; then
echo 'Failed to resolve C:\windows\system32.' >&2
exit 1
fi
# create native dll override
overrideDll() {
$wine reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v $1 /d native /f >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo -e "Failed to add override for $1"
exit 1
fi
}
# remove dll override
restoreDll() {
$wine reg delete 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v $1 /f > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Failed to remove override for $1"
fi
}
# copy or link dxvk dll, back up original file
installFile() {
dstfile="${1}/${3}.dll"
srcfile="${basedir}/${2}/${3}.dll"
if [ -f "${srcfile}.so" ]; then
srcfile="${srcfile}.so"
fi
if ! [ -f "${srcfile}" ]; then
echo "${srcfile}: File not found. Skipping." >&2
return 1
fi
if [ -n "$1" ]; then
if [ -f "${dstfile}" ] || [ -h "${dstfile}" ]; then
if ! [ -f "${dstfile}.old" ]; then
mv "${dstfile}" "${dstfile}.old"
else
rm "${dstfile}"
fi
$file_cmd "${srcfile}" "${dstfile}"
else
echo "${dstfile}: File not found in wine prefix" >&2
return 1
fi
fi
return 0
}
# remove dxvk dll, restore original file
uninstallFile() {
dstfile="${1}/${3}.dll"
srcfile="${basedir}/${2}/${3}.dll"
if [ -f "${srcfile}.so" ]; then
srcfile="${srcfile}.so"
fi
if ! [ -f "${srcfile}" ]; then
echo "${srcfile}: File not found. Skipping." >&2
return 1
fi
if ! [ -f "${dstfile}" ] && ! [ -h "${dstfile}" ]; then
echo "${dstfile}: File not found. Skipping." >&2
return 1
fi
if [ -f "${dstfile}.old" ]; then
rm "${dstfile}"
mv "${dstfile}.old" "${dstfile}"
return 0
else
return 1
fi
}
install() {
installFile "$win32_sys_path" "x32" "$1"
inst32_ret="$?"
installFile "$win64_sys_path" "x64" "$1"
inst64_ret="$?"
if [ "$inst32_ret" -eq 0 ] || [ "$inst64_ret" -eq 0 ]; then
overrideDll "$1"
fi
}
uninstall() {
uninstallFile "$win32_sys_path" "x32" "$1"
uninst32_ret="$?"
uninstallFile "$win64_sys_path" "x64" "$1"
uninst64_ret="$?"
if [ "$uninst32_ret" -eq 0 ] || [ "$uninst64_ret" -eq 0 ]; then
restoreDll "$1"
fi
}
# skip dxgi during install if not explicitly
# enabled, but always try to uninstall it
if [ $with_dxgi -ne 0 ] || [ "$action" == "uninstall" ]; then
$action dxgi
fi
$action d3d10
$action d3d10_1
$action d3d10core
$action d3d11
...@@ -6,15 +6,19 @@ zenity --progress --title="Settings..." --text="Updating start parameters" --pul ...@@ -6,15 +6,19 @@ zenity --progress --title="Settings..." --text="Updating start parameters" --pul
} }
######################################################################## ########################################################################
. "$(dirname $(readlink -f "$0"))/runlib" . "$(dirname $(readlink -f "$0"))/runlib"
wget -T 2 --output-document="${link}/dxvk.tar.gz" $(curl —silent "https://api.github.com/repos/doitsujin/dxvk/releases/latest" | grep -Po '"browser_download_url": "\K.*?(?=")') | sszen ${WINESERVER} -k
if [ $? -eq 1 ]; then wget -T 5 --output-document="${link}/dxvk.tar.gz" $(curl —silent "https://api.github.com/repos/doitsujin/dxvk/releases/latest" | grep -Po '"browser_download_url": "\K.*?(?=")') | sszen
if [ $? -eq 1 ]
then
zenity --error --title "Ошибка!" --text "Не удалось скачать скрипт установки DXVK, проверьте соединение с интернетом и повторите настройку запустив ярлык start_settings из каталога: \n\n"${PORT_WINE_PATH}/settings/"" --no-wrap zenity --error --title "Ошибка!" --text "Не удалось скачать скрипт установки DXVK, проверьте соединение с интернетом и повторите настройку запустив ярлык start_settings из каталога: \n\n"${PORT_WINE_PATH}/settings/"" --no-wrap
exit 1; exit 1
fi fi
rm -f "${link}"/setup_dxvk.sh rm -f "${link}"/setup_dxvk.sh
rm -fr "${link}"/x32
rm -fr "${link}"/x64
tar -xzvf "${link}"/dxvk.tar.gz -C "${link}" tar -xzvf "${link}"/dxvk.tar.gz -C "${link}"
rm -f "${link}"/dxvk.tar.gz rm -f "${link}"/dxvk.tar.gz
mv "${link}"/dxvk-*/setup_dxvk.sh "${link}"/setup_dxvk.sh mv "${link}"/dxvk-*/* "${link}"/
rm -fr "${link}"/dxvk-* rm -fr "${link}"/dxvk-*
start_settings=`zenity --title "${ss_title}" --text "${ss_text}" --list --radiolist \ start_settings=`zenity --title "${ss_title}" --text "${ss_text}" --list --radiolist \
--column="${inst_set}" --column "${ss_ver}" --column "${ss_dr}" --width=600 --height=300 \ --column="${inst_set}" --column "${ss_ver}" --column "${ss_dr}" --width=600 --height=300 \
...@@ -23,12 +27,12 @@ FALSE "OpenGL" "${ss_ogl_2}" \ ...@@ -23,12 +27,12 @@ FALSE "OpenGL" "${ss_ogl_2}" \
FALSE "DXVK_latest" "AMD/Intel: latest: Nvidia: latest" \ FALSE "DXVK_latest" "AMD/Intel: latest: Nvidia: latest" \
FALSE "DXVK_1.2.3" "AMD/Intel: Mesa 19.1-git+: Nvidia: 418.52.05+" \ FALSE "DXVK_1.2.3" "AMD/Intel: Mesa 19.1-git+: Nvidia: 418.52.05+" \
FALSE "DXVK_1.0.3" "AMD: Mesa 18.1.2+; Nvidia:396.24.02+" ` FALSE "DXVK_1.0.3" "AMD: Mesa 18.1.2+; Nvidia:396.24.02+" `
if [ $? -eq 1 ];then exit 1; fi if [ $? -eq 1 ];then exit 1; fi
case $start_settings in case $start_settings in
"${ss_default_1}") "${ss_default_1}")
bash "${link}/setup_dxvk.sh" "uninstall" | sszen sh "${link}/setup_dxvk.sh" "uninstall" | sszen
if [ -e "${config_path}/dxvk" ] if [ -e "${config_path}/dxvk" ]
then then
rm -f "${config_path}/dxvk" rm -f "${config_path}/dxvk"
...@@ -66,7 +70,7 @@ EOF ...@@ -66,7 +70,7 @@ EOF
;; ;;
"OpenGL") "OpenGL")
bash "${link}/setup_dxvk.sh" "uninstall" | sszen sh "${link}/setup_dxvk.sh" "uninstall" | sszen
if [ -e "${config_path}/dxvk" ] if [ -e "${config_path}/dxvk" ]
then then
rm -f "${config_path}/dxvk" rm -f "${config_path}/dxvk"
...@@ -84,7 +88,7 @@ EOF ...@@ -84,7 +88,7 @@ EOF
;; ;;
"DXVK_1.0.3") "DXVK_1.0.3")
bash "${link}/setup_dxvk.sh" "uninstall" | sszen sh "${link}/setup_dxvk.sh" "uninstall" | sszen
sh "${link}/winetricks" -q --force dxvk103 | sszen sh "${link}/winetricks" -q --force dxvk103 | sszen
echo "DXVK is enabled" > "${config_path}/dxvk" echo "DXVK is enabled" > "${config_path}/dxvk"
...@@ -100,7 +104,7 @@ EOF ...@@ -100,7 +104,7 @@ EOF
;; ;;
"DXVK_1.2.3") "DXVK_1.2.3")
bash "${link}/setup_dxvk.sh" "uninstall" | sszen sh "${link}/setup_dxvk.sh" "uninstall" | sszen
sh "${link}/winetricks" -q --force dxvk123 | sszen sh "${link}/winetricks" -q --force dxvk123 | sszen
echo "DXVK is enabled" > "${config_path}/dxvk" echo "DXVK is enabled" > "${config_path}/dxvk"
...@@ -116,7 +120,7 @@ EOF ...@@ -116,7 +120,7 @@ EOF
;; ;;
"DXVK_latest") "DXVK_latest")
bash "${link}/setup_dxvk.sh" "uninstall" | sszen sh "${link}/setup_dxvk.sh" "uninstall" | sszen
sh "${link}/winetricks" -q --force dxvk | sszen sh "${link}/winetricks" -q --force dxvk | sszen
echo "DXVK is enabled" > "${config_path}/dxvk" echo "DXVK is enabled" > "${config_path}/dxvk"
...@@ -131,6 +135,7 @@ STOP_PORTWINE ...@@ -131,6 +135,7 @@ STOP_PORTWINE
EOF EOF
;; ;;
esac esac
######################################################################## ########################################################################
...@@ -9,6 +9,11 @@ export gamestart="c:\\Games\\${gamedir}\\ .exe" ...@@ -9,6 +9,11 @@ export gamestart="c:\\Games\\${gamedir}\\ .exe"
export PATH_TO_GAME="${PORT_WINE_PATH}/data/prefix/drive_c/Games/${gamedir}/" export PATH_TO_GAME="${PORT_WINE_PATH}/data/prefix/drive_c/Games/${gamedir}/"
######################################################################## ########################################################################
export runtime_libs=0 export runtime_libs=0
#export __GL_SYNC_TO_VBLANK=0
#export vblank_mode=0
export PROTON_FORCE_LARGE_ADDRESS_AWARE=0
export STAGING_SHARED_MEMORY=1
export WINEDEBUG="-all"
######################################################################## ########################################################################
WINE_DX_TO_OPENGL () WINE_DX_TO_OPENGL ()
{ {
...@@ -24,15 +29,6 @@ export WINEDLLOVERRIDES="winemenubuilder.exe=d" ...@@ -24,15 +29,6 @@ export WINEDLLOVERRIDES="winemenubuilder.exe=d"
export DXVK_HUD=fps export DXVK_HUD=fps
#export PROTON_USE_D9VK=1 #export PROTON_USE_D9VK=1
} }
###.NVIDIA.###
#export LD_PRELOAD="libpthread.so.0 libGL.so.1"
#export __GL_THREADED_OPTIMIZATIONS=1
#export __GL_SYNC_TO_VBLANK=0
#export vblank_mode=0
###.OTHER.###
export PROTON_FORCE_LARGE_ADDRESS_AWARE=0
export STAGING_SHARED_MEMORY=1
export WINEDEBUG="-all"
######################################################################## ########################################################################
ADD_IN_START_PORTWINE () ADD_IN_START_PORTWINE ()
{ {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment