Commit 8d1fd441 authored by Mikhail Tergoev's avatar Mikhail Tergoev

Fix remove and install DXVK

parent 801cbc12
......@@ -10,7 +10,11 @@ do
zenity --info --text "You need to install: ${PROGS}"
fi
done
########################################################################
sszen() {
zenity --progress --title="Settings..." --text="Updating start parameters" --pulsate --auto-close --auto-kill --width=450
}
########################################################################
cd "$(dirname "`readlink -f "$0"`")"
export link="$(pwd)"
cd "${link}/../../"
......@@ -58,20 +62,24 @@ export PATH_OLD="$PATH"
########################################################################
GLIBC_REQUIRED=2.27
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 [ ! -d "${PORT_WINE_PATH}"/data/wine ]
then
WINEDIR="${PORT_WINE_PATH}"/data/wine_glibc_223
if [ -d "${PORT_WINE_PATH}/data/wine_glibc_227" ]
if [ "$(echo ${GLIBC_VERSION} | sed 's/\.//g')" -lt "$(echo ${GLIBC_REQUIRED} | sed 's/\.//g')" ]
then
rm -fr "${PORT_WINE_PATH}"/data/wine_glibc_227
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
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
else
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
WINEDIR="${PORT_WINE_PATH}"/data/wine
fi
echo "Used WINE: ${WINEDIR}"
########################################################################
......@@ -123,14 +131,14 @@ export WINEFSYNC=1
export PROTON_NO_FSYNC=0
# Check if Wine has PBA or ESYNC features
if grep PBA "${WINEDIR}/lib/wine/wined3d.dll.so" &>/dev/null || grep PBA "${WINEDIR}/lib64/wine/wined3d.dll.so" &>/dev/null
if grep PBA "${WINEDIR}/lib/wine/wined3d.dll.so" || grep PBA "${WINEDIR}/lib64/wine/wined3d.dll.so" &>/dev/null
then
PBA_ENABLE=1
export PBA_ENABLE=1
else
PBA_ENABLE=0
export PBA_ENABLE=0
fi
#if grep ESYNC "${WINEDIR}/lib/wine/ntdll.dll.so" &>/dev/null || grep ESYNC "${WINEDIR}/lib64/wine/ntdll.dll.so" &>/dev/null
#if grep ESYNC "${WINEDIR}/lib/wine/ntdll.dll.so"|| grep ESYNC "${WINEDIR}/lib64/wine/ntdll.dll.so" &>/dev/null
#then
# if ! ulimit -n 500000 &>/dev/null
# then
......@@ -139,8 +147,8 @@ fi
# export WINEESYNC=1
# fi
#fi
chmod -R 777 "${WINEPREFIX}"
${WINESERVER} -k
"${WINESERVER}" -k
chmod -R 755 "${WINEPREFIX}"
########################################################################
START_PORTWINE ()
......@@ -188,55 +196,73 @@ done
echo disable > "$WINEPREFIX/.update-timestamp"
ADD_IN_START_PORTWINE
${WINEBOOT} -r
}
########################################################################
WAIT_WINESERVER ()
{
sleep 3
while [ $(pgrep wineserver)>'0' ]
do
sleep 1
done
}
########################################################################
RM_DXVK ()
{
"${WINESERVER}" -k
WAIT_WINESERVER
sed -i 's/\*d/d/g' "${WINEPREFIX}/user.reg"
for rm_userreg in "d3d10" "d3d10_1" "d3d10core" "d3d11" "dxgi"
do
sed -i "/$rm_userreg/d" "${WINEPREFIX}/user.reg"
rm -f "${WINEPREFIX}/drive_c/windows/system32/${rm_userreg}".dll
rm -f "${WINEPREFIX}/drive_c/windows/syswow64/${rm_userreg}".dll
done
"${WINEBOOT}" -u
WAIT_WINESERVER
echo "DXVK has been deleted"
}
########################################################################
OPENGL_SET ()
{
if [ -e "${config_path}/dxvk" ]
if grep DXVK "${WINEPREFIX}/drive_c/windows/system32/d3d11.dll" || grep DXVK "${WINEPREFIX}/drive_c/windows/syswow64/d3d11.dll"
then
sh "${link}/setup_dxvk.sh" "uninstall"
rm -f "${config_path}/dxvk"
RM_DXVK | sszen
fi
if grep DXVK "${WINEPREFIX}/drive_c/windows/system32/d3d11.dll" || grep DXVK "${WINEPREFIX}/drive_c/windows/syswow64/d3d11.dll"
then
echo "Error replacing DXVK files"
else
echo "DXVK is disabled"
echo "Ok. DXVK is disabled"
fi
export PROTON_USE_WINED3D=1
export PROTON_USE_D9VK=0
export DXVK_STATE_CACHE=0
export __GL_SHADER_DISK_CACHE_PATH="${PATH_TO_GAME}"
export __GL_SHADER_DISK_CACHE=1
export mesa_glthread="true"
#export mesa_glthread="true"
}
########################################################################
VULKAN_SET ()
{
if [ -e "${config_path}/dxvk" ]
if ! grep DXVK "${WINEPREFIX}/drive_c/windows/system32/d3d11.dll" || ! grep DXVK "${WINEPREFIX}/drive_c/windows/syswow64/d3d11.dll"
then
echo "DXVK is enabled"
else
sh "${link}/winetricks" -q --force dxvk
echo "DXVK is enabled" > "${config_path}/dxvk"
WAIT_WINESERVER
fi
echo "DXVK is enabled"
export PROTON_USE_WINED3D=0
export __GL_SHADER_DISK_CACHE=0
export DXVK_STATE_CACHE_PATH="${PATH_TO_GAME}"
export DXVK_STATE_CACHE=1
export mesa_glthread="false"
}
########################################################################
STOP_PORTWINE ()
{
echo " "
sleep 5
while [ $(pgrep wineserver)>'0' ]
do
sleep 5
done
WAIT_WINESERVER
if [ "${update_loc}" = "RUS" ]
then
......
......@@ -90,6 +90,7 @@ fi
ln -s "${PORT_WINE_PATH}/data/prefix/drive_c/" "${PORT_WINE_PATH}/drive_c"
ADD_IN_POST_INSTALL
RM_DXVK
sh "${link}/start_settings"
exit 0
#!/bin/bash
# Author: PortWINE-Linux.ru
########################################################################
sszen() {
zenity --progress --title="Settings..." --text="Updating start parameters" --pulsate --auto-close --auto-kill --width=450
}
########################################################################
. "$(dirname $(readlink -f "$0"))/runlib"
${WINESERVER} -k
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
exit 1
fi
rm -f "${link}"/setup_dxvk.sh
rm -fr "${link}"/x32
rm -fr "${link}"/x64
tar -xzvf "${link}"/dxvk.tar.gz -C "${link}"
rm -f "${link}"/dxvk.tar.gz
mv "${link}"/dxvk-*/* "${link}"/
rm -fr "${link}"/dxvk-*
sed -i 's/\*d/d/g' "${WINEPREFIX}/user.reg"
start_settings=`zenity --title "${ss_title}" --text "${ss_text}" --list --radiolist \
--column="${inst_set}" --column "${ss_ver}" --column "${ss_dr}" --width=600 --height=300 \
TRUE "${ss_default_1}" "${ss_default_2}" \
......@@ -31,18 +9,16 @@ 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.0.3" "AMD: Mesa 18.1.2+; Nvidia:396.24.02+" `
if [ $? -eq 1 ];then exit 1; fi
case $start_settings in
"${ss_default_1}")
sh "${link}/setup_dxvk.sh" "uninstall" | sszen
if [ -e "${config_path}/dxvk" ]
RM_DXVK | sszen
if grep DXVK "${WINEPREFIX}/drive_c/windows/system32/d3d11.dll" || grep DXVK "${WINEPREFIX}/drive_c/windows/syswow64/d3d11.dll"
then
rm -f "${config_path}/dxvk"
echo "error replacing DXVK files"
else
echo "DXVK is disabled"
echo "Ok. DXVK is disabled"
fi
STOP_PORTWINE | sszen
cat > "${link}/start" <<EOF
#!/bin/bash
# Author: Tergoev M.A.
......@@ -51,34 +27,32 @@ xsd=\`zenity --title "\${port_start1}" --text "\${port_start2}" --list --radiol
--column="\${inst_set}" --column "\${port_start3}" \\
TRUE "\${port_start4}" \\
FALSE "\${port_start8}" \`
if [ \$? -eq 1 ];then exit 1; fi
case \$xsd in
"\${port_start4}")
START_PORTWINE
WINE_DX_TO_OPENGL
OPENGL_SET
"/usr/bin/xterm" -geometry 150x10 -sb -e '"\${optirun_on}" "\${WINELOADER}" "\${gamestart}" "\${launch_parameters}"' ;;
"/usr/bin/xterm" -geometry 130x13 -sb -e 'echo "--------------------------------------------------------PORTWINE-LINUX.RU--------------------------------------------------------" && "\${optirun_on}" "\${WINELOADER}" "\${gamestart}" "\${launch_parameters}"' ;;
"\${port_start8}")
START_PORTWINE
WINE_DX_TO_VULKAN
VULKAN_SET
"/usr/bin/xterm" -geometry 150x10 -sb -e '"\${optirun_on}" "\${WINELOADER}" "\${gamestart}" "\${launch_parameters}"' ;;
"/usr/bin/xterm" -geometry 130x13 -sb -e 'echo "--------------------------------------------------------PORTWINE-LINUX.RU--------------------------------------------------------" && "\${optirun_on}" "\${WINELOADER}" "\${gamestart}" "\${launch_parameters}"' ;;
esac
STOP_PORTWINE
EOF
;;
"OpenGL")
sh "${link}/setup_dxvk.sh" "uninstall" | sszen
if [ -e "${config_path}/dxvk" ]
RM_DXVK | sszen
if grep DXVK "${WINEPREFIX}/drive_c/windows/system32/d3d11.dll" || grep DXVK "${WINEPREFIX}/drive_c/windows/syswow64/d3d11.dll"
then
rm -f "${config_path}/dxvk"
echo "error replacing DXVK files"
else
echo "Ok. DXVK is disabled"
fi
STOP_PORTWINE | sszen
cat > "${link}/start" <<EOF
#!/bin/bash
# Author: Tergoev M.A.
......@@ -86,16 +60,19 @@ cat > "${link}/start" <<EOF
START_PORTWINE
WINE_DX_TO_OPENGL
OPENGL_SET
"/usr/bin/xterm" -geometry 150x10 -sb -e '"\${optirun_on}" "\${WINELOADER}" "\${gamestart}" "\${launch_parameters}"'
"/usr/bin/xterm" -geometry 130x13 -sb -e 'echo "--------------------------------------------------------PORTWINE-LINUX.RU--------------------------------------------------------" && "\${optirun_on}" "\${WINELOADER}" "\${gamestart}" "\${launch_parameters}"'
STOP_PORTWINE
EOF
;;
"DXVK_1.0.3")
sh "${link}/setup_dxvk.sh" "uninstall" | sszen
sh "${link}/winetricks" -q --force dxvk103 | sszen
echo "DXVK is enabled" > "${config_path}/dxvk"
if grep DXVK "${WINEPREFIX}/drive_c/windows/system32/d3d11.dll" || grep DXVK "${WINEPREFIX}/drive_c/windows/syswow64/d3d11.dll"
then
RM_DXVK | sszen
echo "Old DXVK is disabled"
fi
sh "${link}/winetricks" --force dxvk103 | sszen
STOP_PORTWINE | sszen
echo "New DXVK is enabled"
cat > "${link}/start" <<EOF
#!/bin/bash
# Author: Tergoev M.A.
......@@ -103,16 +80,19 @@ cat > "${link}/start" <<EOF
START_PORTWINE
WINE_DX_TO_VULKAN
VULKAN_SET
"/usr/bin/xterm" -geometry 150x10 -sb -e '"\${optirun_on}" "\${WINELOADER}" "\${gamestart}" "\${launch_parameters}"'
"/usr/bin/xterm" -geometry 130x13 -sb -e 'echo "--------------------------------------------------------PORTWINE-LINUX.RU--------------------------------------------------------" && "\${optirun_on}" "\${WINELOADER}" "\${gamestart}" "\${launch_parameters}"'
STOP_PORTWINE
EOF
;;
"DXVK_1.2.3")
sh "${link}/setup_dxvk.sh" "uninstall" | sszen
sh "${link}/winetricks" -q --force dxvk123 | sszen
echo "DXVK is enabled" > "${config_path}/dxvk"
if grep DXVK "${WINEPREFIX}/drive_c/windows/system32/d3d11.dll" || grep DXVK "${WINEPREFIX}/drive_c/windows/syswow64/d3d11.dll"
then
RM_DXVK | sszen
echo "Old DXVK is disabled"
fi
sh "${link}/winetricks" --force dxvk123 | sszen
STOP_PORTWINE | sszen
echo "New DXVK is enabled"
cat > "${link}/start" <<EOF
#!/bin/bash
# Author: Tergoev M.A.
......@@ -120,16 +100,19 @@ cat > "${link}/start" <<EOF
START_PORTWINE
WINE_DX_TO_VULKAN
VULKAN_SET
"/usr/bin/xterm" -geometry 150x10 -sb -e '"\${optirun_on}" "\${WINELOADER}" "\${gamestart}" "\${launch_parameters}"'
"/usr/bin/xterm" -geometry 130x13 -sb -e 'echo "--------------------------------------------------------PORTWINE-LINUX.RU--------------------------------------------------------" && "\${optirun_on}" "\${WINELOADER}" "\${gamestart}" "\${launch_parameters}"'
STOP_PORTWINE
EOF
;;
"DXVK_latest")
sh "${link}/setup_dxvk.sh" "uninstall" | sszen
sh "${link}/winetricks" -q --force dxvk | sszen
echo "DXVK is enabled" > "${config_path}/dxvk"
if grep DXVK "${WINEPREFIX}/drive_c/windows/system32/d3d11.dll" || grep DXVK "${WINEPREFIX}/drive_c/windows/syswow64/d3d11.dll"
then
RM_DXVK | sszen
echo "Old DXVK is disabled"
fi
sh "${link}/winetricks" --force dxvk | sszen
STOP_PORTWINE | sszen
echo "New DXVK is enabled"
cat > "${link}/start" <<EOF
#!/bin/bash
# Author: Tergoev M.A.
......@@ -137,13 +120,8 @@ cat > "${link}/start" <<EOF
START_PORTWINE
WINE_DX_TO_VULKAN
VULKAN_SET
"/usr/bin/xterm" -geometry 150x10 -sb -e '"\${optirun_on}" "\${WINELOADER}" "\${gamestart}" "\${launch_parameters}"'
"/usr/bin/xterm" -geometry 130x13 -sb -e 'echo "--------------------------------------------------------PORTWINE-LINUX.RU--------------------------------------------------------" && "\${optirun_on}" "\${WINELOADER}" "\${gamestart}" "\${launch_parameters}"'
STOP_PORTWINE
EOF
;;
esac
${WINESERVER} -k
${WINEBOOT} -r
......@@ -9,6 +9,8 @@ export gamestart="c:\\Games\\${gamedir}\\ .exe"
export PATH_TO_GAME="${PORT_WINE_PATH}/data/prefix/drive_c/Games/${gamedir}/"
########################################################################
export runtime_libs=0
#export LD_PRELOAD="libpthread.so.0 libGL.so.1"
#export __GL_THREADED_OPTIMIZATIONS=1
#export __GL_SYNC_TO_VBLANK=0
#export vblank_mode=0
export PROTON_FORCE_LARGE_ADDRESS_AWARE=0
......
......@@ -5,7 +5,7 @@
rm -f ${link}/winetricks
"/usr/bin/xterm" -e wget -T 3 --output-document="${link}/winetricks" https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
chmod +x "${link}/winetricks"
sed -i '2a . $(dirname $(readlink -f "$0"))/runlib\nSTART_PORTWINE\nexport WINELOADER="${PORT_WINE_PATH}/data/wine/bin/wine" ' "${link}/winetricks"
sed -i '15a . $(dirname $(readlink -f "$0"))/runlib\nSTART_PORTWINE\nexport WINELOADER="${WINEDIR}/bin/wine" ' "${link}/winetricks"
sleep 1
export WINEDEBUG=""
"/usr/bin/xterm" -e "${WINEBOOT}" -u
......
#!/bin/sh
# shellcheck disable=SC2030,SC2031
. $(dirname $(readlink -f "$0"))/runlib
START_PORTWINE
export WINELOADER="${PORT_WINE_PATH}/data/wine/bin/wine"
# SC2030: Modification of WINE is local (to subshell caused by (..) group).
# SC2031: WINE was modified in a subshell. That change might be lost
# This has to be right after the shebang, see: https://github.com/koalaman/shellcheck/issues/779
......@@ -16,6 +13,9 @@ WINETRICKS_VERSION=20190912-next
# You should see a micro (u with a tail) here [µ]
# You should see a trademark symbol here [™]
. $(dirname $(readlink -f "$0"))/runlib
START_PORTWINE
export WINELOADER="${WINEDIR}/bin/wine"
#--------------------------------------------------------------------
#
# Winetricks is a package manager for Win32 dlls and applications on POSIX.
......
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