1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#!/bin/bash
# Author: PortWINE-Linux.ru
########################################################################
[ $(id -u) -eq 0 ] && echo "Do not run this script as root!" && zenity --error --text "Do not run this script as root!" && exit 1
########################################################################
sszen() {
zenity --progress --title="Settings..." --text="Updating start parameters" --pulsate --auto-close --auto-kill --width=450
}
########################################################################
pwzen() {
zenity --progress --title="Settings..." --text="Please wait!" --pulsate --auto-close --auto-kill --width=450
}
########################################################################
wine_pids=$(ls -l /proc/*/exe 2>/dev/null | grep -E 'wine(64)?-preloader|wineserver' | perl -pe 's;^.*/proc/(\d+)/exe.*$;$1;g;')
if ! [ -z "${wine_pids}" ] ; then
kill -9 ${wine_pids}
fi
########################################################################
export kill_winedevice=0
export kill_explorer=0
########################################################################
cd "$(dirname "`readlink -f "$0"`")"
export link="$(pwd)"
cd "${link}/../../"
export PORT_WINE_PATH="$(pwd)"
cd "${link}"
. "${link}"/vars
export config_path="${PORT_WINE_PATH}/data/tmp"
if [ ! -d "${config_path}" ]
then
mkdir -p "${config_path}"
fi
if [ ! -e "${config_path}/${portname}_loc" ]
then
SET_LANG=`zenity --title "Install $portname" --text "Select the language\nВыберите язык" --list --radiolist \
--column="Set (Выбор)" --column "Language (Язык):" \
TRUE "RUS" \
FALSE "ENG" `
echo "${SET_LANG}" > "${config_path}/${portname}_loc"
fi
. "${link}"/lang
if [ ! -e "${config_path}/${portname}_ver" ]
then
echo "10" > "${config_path}/${portname}_ver"
fi
if [ ! -f "${config_path}/dxvk_on" ]
then
start_settings=`zenity --title "${ss_title}" --text "${ss_text}" --list --radiolist \
--column="${inst_set}" --column "${ss_ver}" --column "${ss_dr}" --width=600 --height=250 \
FALSE "OpenGL" "${ss_ogl_2}" \
FALSE "DXVK+HUD" "${ss_ogl_3} + HUD" \
TRUE "DXVK" "${ss_ogl_3}" `
if [ $? -eq 1 ];then exit 1; fi
case $start_settings in
"OpenGL")
echo "0" > "${config_path}/dxvk_on" ;;
"DXVK")
echo "1" > "${config_path}/dxvk_on" ;;
"DXVK+HUD")
echo "2" > "${config_path}/dxvk_on" ;;
esac
fi
read "var_dxvk_on" < "${config_path}/dxvk_on"
export "var_dxvk_on"
if [ ! -x "`which "gamemode" 2>/dev/null`" ]
then
# LD_PRELOAD="$LD_PRELOAD:/usr/${LIB}/libgamemodeauto.so"
var_gamemode="gamemoderun"
else
var_gamemode=`echo "Gamemod not installed!"`
fi
########################################################################
WINEDIR="${PORT_WINE_PATH}"/data/dist
WINELIB="${PORT_WINE_PATH}"/data/libs
export PROTONRUN="${PORT_WINE_PATH}/data/proton"
export WINEARCH=win64
export WINELOADER="${WINEDIR}/bin/wine"
export WINEDLLPATH="${WINEDIR}/lib64/wine:${WINEDIR}/lib/wine"
export WINESERVER="${WINEDIR}/bin/wineserver"
export WINEBOOT="${WINEDIR}/bin/wineboot"
export WINEPREFIX="${PORT_WINE_PATH}/data/pfx"
export PATH="${WINEDIR}/bin":${PATH}
export WINESTART="C:\\windows\\command\\start.exe"
export STEAM_COMPAT_DATA_PATH="${PORT_WINE_PATH}/data/"
export LD_LIBRARY_PATH="${WINEDIR}/lib64/wine:${WINEDIR}/lib/wine:${WINELIB}/pinned_libs_32:${WINELIB}/pinned_libs_64:/usr/lib/x86_64-linux-gnu/libfakeroot:/lib/i386-linux-gnu:/usr/lib/i386-linux-gnu:/usr/local/lib:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib:/usr/lib/i386-linux-gnu/i686:/usr/lib/i386-linux-gnu/sse2:/usr/lib/i386-linux-gnu/i686/sse2:${WINELIB}/i386/lib/i386-linux-gnu:${WINELIB}/i386/lib:${WINELIB}/i386/usr/lib/i386-linux-gnu:${WINELIB}/i386/usr/lib:${WINELIB}/amd64/lib/x86_64-linux-gnu:${WINELIB}/amd64/lib:${WINELIB}/amd64/usr/lib/x86_64-linux-gnu:${WINELIB}/amd64/usr/lib"
########################################################################
export DXVK_STATE_CACHE_PATH="${PATH_TO_GAME}"
export DXVK_STATE_CACHE=1
export __GL_SHADER_DISK_CACHE_PATH="${PATH_TO_GAME}"
export __GL_SHADER_DISK_CACHE=1
export __GL_SHADER_DISK_CACHE_SIZE=1000000000
export __GL_THREADED_OPTIMIZATIONS=1
export mesa_glthread=true
export DRI_PRIME=1
export urlg="http://portwine-linux.ru/donate"
########################################################################
START_PORTWINE ()
{
sh "${link}"/port_update
if [ "${var_dxvk_on}" -eq "1" ]
then
export DXVK_HUD=0
elif [ "${var_dxvk_on}" -eq "2" ]
then
export DXVK_HUD="fps,devinfo"
fi
export DXVK_CONFIG_FILE="${PORT_WINE_PATH}/data/dxvk.conf"
export def_pfx="${PORT_WINE_PATH}data/dist/share/default_pfx/"
if [ ! -d "${def_pfx}" ]
then
"${PROTONRUN}" "run" | pwzen
fi
ADD_IN_START_PORTWINE
}
########################################################################
WAIT_WINESERVER ()
{
sleep 3
while [ $(pgrep wineserver)>'0' ]
do
sleep 2
done
}
########################################################################
KILL9_WINEDEVICE ()
{
if [ "${kill_winedevice}" -eq "1" ]
then
sleep 10
killall -r -s9 winedevice
fi
if [ "${kill_explorer}" -eq "1" ]
then
sleep 10
killall -r -s9 explorer
fi
}
########################################################################
STOP_PORTWINE ()
{
WAIT_WINESERVER
ADD_IN_STOP_PORTWINE
sleep 3
killall -r -s9 winedevice
rm -f "${PORT_WINE_PATH}"/0
rm -f "${link}"/0
}