Commit 66d9182c authored by Mikhail Tergoev's avatar Mikhail Tergoev

Add try_ and check_ function. Fix Unarc.dll in setup db

parent 290a6840
...@@ -22,6 +22,6 @@ export PW_WINEDBG_DISABLE=1 ...@@ -22,6 +22,6 @@ export PW_WINEDBG_DISABLE=1
export PW_FORCE_DISABLED_GAMEMOD=1 # Force disabele gamemod export PW_FORCE_DISABLED_GAMEMOD=1 # Force disabele gamemod
export PW_FORCE_LARGE_ADDRESS_AWARE=0 # Force Wine to enable the LARGE_ADDRESS_AWARE flag for all executables. Enabled by default. export PW_FORCE_LARGE_ADDRESS_AWARE=0 # Force Wine to enable the LARGE_ADDRESS_AWARE flag for all executables. Enabled by default.
#export PULSE_LATENCY_MSEC=60 #export PULSE_LATENCY_MSEC=60
export PW_DLL_INSTALL="vcrun6 mfc42" export PW_DLL_INSTALL="vcrun6 mfc42 vcrun6sp6 7zip"
#export LAUNCH_PARAMETERS="-d3d9" #export LAUNCH_PARAMETERS="-d3d9"
export PW_GUI_DISABLED_CS=1 export PW_GUI_DISABLED_CS=1
...@@ -2,38 +2,22 @@ ...@@ -2,38 +2,22 @@
# Author: PortWINE-Linux.ru # Author: PortWINE-Linux.ru
. "$(dirname $(readlink -f "$0"))/runlib" . "$(dirname $(readlink -f "$0"))/runlib"
rm -f "${PORT_WINE_PATH}/"*".log" try_remove_file "${PORT_WINE_TMP_PATH}/update_notifier"
rm -f "${PORT_WINE_TMP_PATH}/update_notifier" try_remove_file "${PORT_WINE_TMP_PATH}/init_run_suc"
rm -f "${PORT_WINE_TMP_PATH}/init_run_suc"
rm -fr "${PORT_WINE_PATH}/data/pfx/dosdevices"
rm -fr "${PORT_WINE_PATH}/data/port_on"
rm -fr "${PORT_WINE_PATH}/data/dxvk.conf"
rm -f "${PORT_WINE_PATH}/Create_shortcut_PP.desktop"
rm -f "${PORT_WINE_PATH}/Proton.desktop"
rm -f "${PORT_WINE_PATH}/settings.desktop"
rm -f "${PORT_WINE_PATH}/settings.desktop"
rm -f "${PORT_WINE_PATH}/debug.desktop"
if [ -d "${PORT_WINE_PATH}/Settings" ]; then try_remove_file "${PORT_WINE_PATH}/data/port_on"
rm -fr "${PORT_WINE_PATH}/Settings" try_remove_file "${PORT_WINE_PATH}/data/dxvk.conf"
fi try_remove_file "${PORT_WINE_PATH}/Create_shortcut_PP.desktop"
if [ ! -z "${PATH_TO_GAME}" ]; then try_remove_file "${PORT_WINE_PATH}/Proton.desktop"
rm -f "${PATH_TO_GAME}"/*.dxvk-cache try_remove_file "${PORT_WINE_PATH}/settings.desktop"
fi try_remove_file "${PORT_WINE_PATH}/settings.desktop"
if [ -f "${PORT_WINE_PATH}/restart.desktop" ]; then try_remove_file "${PORT_WINE_PATH}/debug.desktop"
rm "${PORT_WINE_PATH}/restart.desktop" try_remove_file "${PORT_WINE_PATH}/restart.desktop"
fi
if [ ! -d "/home/${USER}/.local/share/applications" ] try_remove_dir "${PORT_WINE_PATH}/data/pfx/dosdevices"
then try_remove_dir "${PORT_WINE_PATH}/Settings"
mkdir -p "/home/${USER}/.local/share/applications"
else create_new_dir "/home/${USER}/.local/share/applications"
if [ -e "/home/${USER}/.local/share/applications/Create_shortcut_PP.desktop" ]; then
rm -f "/home/${USER}/.local/share/applications/Create_shortcut_PP.desktop"
fi
if [ -e "/home/${USER}/.local/share/applications/Proton.desktop" ]; then
rm -f "/home/${USER}/.local/share/applications/Proton.desktop"
fi
fi
if ! [ "${portname}" = "PortProton" ]; then if ! [ "${portname}" = "PortProton" ]; then
name_desktop="${gamename}" name_desktop="${gamename}"
...@@ -84,9 +68,8 @@ do ...@@ -84,9 +68,8 @@ do
chmod u+x "${PORT_WINE_PATH}/${name_desktop}.desktop" chmod u+x "${PORT_WINE_PATH}/${name_desktop}.desktop"
done done
chmod u+x "${PORT_SCRIPTS_PATH}/"* chmod u+x "${PORT_SCRIPTS_PATH}/"*
if [ ! -d "${PORT_WINE_PATH}/drive_c" ]; then
ln -s "${PORT_WINE_PATH}/data/pfx/drive_c/" "${PORT_WINE_PATH}/drive_c" try_force_link_dir "${PORT_WINE_PATH}/data/pfx/drive_c/" "${PORT_WINE_PATH}/drive_c"
fi
if [ -d "${PORT_WINE_PATH}/data/pfx/drive_c/users/Public" ] && [ ! -L "${PORT_WINE_PATH}/data/pfx/drive_c/users/Public" ]; then if [ -d "${PORT_WINE_PATH}/data/pfx/drive_c/users/Public" ] && [ ! -L "${PORT_WINE_PATH}/data/pfx/drive_c/users/Public" ]; then
cp -fr "${PORT_WINE_PATH}/data/pfx/drive_c/users/Public"/* "${PORT_WINE_PATH}/data/pfx/drive_c/users/steamuser/" cp -fr "${PORT_WINE_PATH}/data/pfx/drive_c/users/Public"/* "${PORT_WINE_PATH}/data/pfx/drive_c/users/steamuser/"
rm -fr "${PORT_WINE_PATH}/data/pfx/drive_c/users/Public" rm -fr "${PORT_WINE_PATH}/data/pfx/drive_c/users/Public"
...@@ -94,13 +77,16 @@ elif [ -L "${PORT_WINE_PATH}/data/pfx/drive_c/users/Public" ]; then ...@@ -94,13 +77,16 @@ elif [ -L "${PORT_WINE_PATH}/data/pfx/drive_c/users/Public" ]; then
rm -fr "${PORT_WINE_PATH}/data/pfx/drive_c/users/Public" rm -fr "${PORT_WINE_PATH}/data/pfx/drive_c/users/Public"
fi fi
ln -s "${PORT_WINE_PATH}/data/pfx/drive_c/users/steamuser" "${PORT_WINE_PATH}/data/pfx/drive_c/users/Public" ln -s "${PORT_WINE_PATH}/data/pfx/drive_c/users/steamuser" "${PORT_WINE_PATH}/data/pfx/drive_c/users/Public"
if [ ! -d "${PORT_WINE_PATH}/data/pfx/drive_c/users/${USER}" ]; then if [ ! -d "${PORT_WINE_PATH}/data/pfx/drive_c/users/${USER}" ]; then
ln -s "${PORT_WINE_PATH}/data/pfx/drive_c/users/steamuser" "${PORT_WINE_PATH}/data/pfx/drive_c/users/${USER}" ln -s "${PORT_WINE_PATH}/data/pfx/drive_c/users/steamuser" "${PORT_WINE_PATH}/data/pfx/drive_c/users/${USER}"
fi fi
if [ -e "${PORT_WINE_PATH}/data/pfx/system.reg" ] || [ -e "${PORT_WINE_PATH}/data/pfx/user.reg" ] || [ -e "${PORT_WINE_PATH}/data/pfx/userdef.reg" ]; then if [ -e "${PORT_WINE_PATH}/data/pfx/system.reg" ] || [ -e "${PORT_WINE_PATH}/data/pfx/user.reg" ] || [ -e "${PORT_WINE_PATH}/data/pfx/userdef.reg" ]; then
sed -i "s/xuser/${USER}/g" "${PORT_WINE_PATH}/data/pfx/"*.reg sed -i "s/xuser/${USER}/g" "${PORT_WINE_PATH}/data/pfx/"*.reg
sed -i "s/vagrant/${USER}/g" "${PORT_WINE_PATH}/data/pfx/"*.reg sed -i "s/vagrant/${USER}/g" "${PORT_WINE_PATH}/data/pfx/"*.reg
fi fi
if [ "${s_install}" = "1" ]; then if [ "${s_install}" = "1" ]; then
echo "Installation completed successfully." echo "Installation completed successfully."
else else
......
...@@ -47,7 +47,7 @@ if [ -x "`which wrestool 2>/dev/null`" ]; then ...@@ -47,7 +47,7 @@ if [ -x "`which wrestool 2>/dev/null`" ]; then
cp -f "${PORTPROTON_EXE}.ico" "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.ico" cp -f "${PORTPROTON_EXE}.ico" "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.ico"
rm -f "${PORTPROTON_PATH}/"*.ico rm -f "${PORTPROTON_PATH}/"*.ico
fi fi
if [ $? -eq 1 ];then exit 1; fi if [ $? -eq 1 ] ; then exit 1 ; fi
export PW_VULKAN_TO_DB=`cat "${PORT_WINE_TMP_PATH}/pw_vulkan"` export PW_VULKAN_TO_DB=`cat "${PORT_WINE_TMP_PATH}/pw_vulkan"`
if [ ! -z "${PORTWINE_DB}" ]; then if [ ! -z "${PORTWINE_DB}" ]; then
PORTWINE_DB_FILE=`grep -il "${PORTWINE_DB}" "${PORT_SCRIPTS_PATH}/portwine_db"/* | sed s/".exe"/""/gi` PORTWINE_DB_FILE=`grep -il "${PORTWINE_DB}" "${PORT_SCRIPTS_PATH}/portwine_db"/* | sed s/".exe"/""/gi`
...@@ -147,9 +147,7 @@ echo "log WINE:" >> "${PORT_WINE_PATH}/${portname}.log" ...@@ -147,9 +147,7 @@ echo "log WINE:" >> "${PORT_WINE_PATH}/${portname}.log"
export DXVK_HUD="full" export DXVK_HUD="full"
export PW_XTERM="${WINELIB}/amd64/usr/bin/xterm -l -lf ${PORT_WINE_PATH}/${portname}.log.wine -geometry 159x37 -e" export PW_XTERM="${WINELIB}/amd64/usr/bin/xterm -l -lf ${PORT_WINE_PATH}/${portname}.log.wine -geometry 159x37 -e"
if [ -f "${PORT_WINE_PATH}/${portname}.log.wine" ]; then try_remove_file "${PORT_WINE_PATH}/${portname}.log.wine"
rm -f "${PORT_WINE_PATH}/${portname}.log.wine"
fi
if [ ! -z "${portwine_exe}" ]; then if [ ! -z "${portwine_exe}" ]; then
export PATH_TO_GAME="$( cd "$( dirname "${portwine_exe}" )" >/dev/null 2>&1 && pwd )" export PATH_TO_GAME="$( cd "$( dirname "${portwine_exe}" )" >/dev/null 2>&1 && pwd )"
cd "$PATH_TO_GAME" cd "$PATH_TO_GAME"
...@@ -168,21 +166,19 @@ else ...@@ -168,21 +166,19 @@ else
export PATH_TO_GAME="$( cd "$( dirname "${gamestart}" )" >/dev/null 2>&1 && pwd )" export PATH_TO_GAME="$( cd "$( dirname "${gamestart}" )" >/dev/null 2>&1 && pwd )"
cd "$PATH_TO_GAME" cd "$PATH_TO_GAME"
if [ ! -z $optirun_on ]; then if [ ! -z $optirun_on ]; then
$PW_XTERM "${WINELOADER}" ${optirun_on} "${gamestart}" ${LAUNCH_PARAMETERS} 2>&1 & ${optirun_on} $PW_XTERM "${PW_RUNTIME}" "${WINELOADER}" "${gamestart}" ${LAUNCH_PARAMETERS} 2>&1 &
else else
$PW_XTERM "${WINELOADER}" "${gamestart}" ${LAUNCH_PARAMETERS} 2>&1 & $PW_XTERM "${PW_RUNTIME}" "${WINELOADER}" "${gamestart}" ${LAUNCH_PARAMETERS} 2>&1 &
fi fi
fi fi
zenity --info --title "DEBUG" --text "${port_debug}" --no-wrap && "${WINESERVER}" -k zenity --info --title "DEBUG" --text "${port_debug}" --no-wrap && "${WINESERVER}" -k
STOP_PORTWINE | sszen STOP_PORTWINE | sszen
cat "${PORT_WINE_PATH}/${portname}.log.wine" >> "${PORT_WINE_PATH}/${portname}.log" cat "${PORT_WINE_PATH}/${portname}.log.wine" >> "${PORT_WINE_PATH}/${portname}.log"
rm -f "${PORT_WINE_PATH}/${portname}.log.wine" try_remove_file "${PORT_WINE_PATH}/${portname}.log.wine"
deb_text=$(cat "${PORT_WINE_PATH}/${portname}.log" | awk '! a[$0]++') deb_text=$(cat "${PORT_WINE_PATH}/${portname}.log" | awk '! a[$0]++')
echo "$deb_text" > "${PORT_WINE_PATH}/${portname}.log" echo "$deb_text" > "${PORT_WINE_PATH}/${portname}.log"
echo "$deb_text" | zenity --text-info --editable \ echo "$deb_text" | zenity --text-info --editable --width=800 --height=600 --title="${portname}.log"
--width=800 --height=600 \
--title="${portname}.log"
} }
######################################################################## ########################################################################
PW_WINECFG () PW_WINECFG ()
...@@ -215,7 +211,7 @@ PW_WINETRICKS () ...@@ -215,7 +211,7 @@ PW_WINETRICKS ()
UPDATE_WINETRICKS UPDATE_WINETRICKS
export PW_USE_TERMINAL=1 export PW_USE_TERMINAL=1
START_PORTWINE START_PORTWINE
$PW_TERM "${PORT_WINE_TMP_PATH}/winetricks" -q --force $PW_TERM "${PW_RUNTIME}" "${PORT_WINE_TMP_PATH}/winetricks" -q --force
} }
######################################################################## ########################################################################
if [ ! -z "${portwine_exe}" ]; then if [ ! -z "${portwine_exe}" ]; then
......
...@@ -19,12 +19,12 @@ export PROGS_INST="" ...@@ -19,12 +19,12 @@ export PROGS_INST=""
export vexit=0 export vexit=0
for PROGS in "wget" "curl" "tar" for PROGS in "wget" "curl" "tar"
do do
if [ ! -x "`which "${PROGS}" 2>/dev/null`" ];then if [ ! -x "`which "${PROGS}" 2>/dev/null`" ] ; then
PROGS_INST="${PROGS_INST} ${PROGS}" PROGS_INST="${PROGS_INST} ${PROGS}"
vexit=1 vexit=1
fi fi
done done
if [ "${vexit}" -eq "1" ];then if [ "${vexit}" -eq "1" ] ; then
echo "You will need to install: ${PROGS_INST}, and restart the script" echo "You will need to install: ${PROGS_INST}, and restart the script"
exit 1 exit 1
fi fi
...@@ -36,10 +36,10 @@ ARCH_NAME="${setup_script}.tar.xz" ...@@ -36,10 +36,10 @@ ARCH_NAME="${setup_script}.tar.xz"
deflink="/home/${USER}/PortWINE/${portname}" deflink="/home/${USER}/PortWINE/${portname}"
[ $(id -u) -eq 0 ] && echo "Do not run the script from the superuser!" && zenity --error --text "Do not run the script from the superuser!" 2> /dev/null && exit 1 [ $(id -u) -eq 0 ] && echo "Do not run the script from the superuser!" && zenity --error --text "Do not run the script from the superuser!" 2> /dev/null && exit 1
######################################################################## ########################################################################
if [ "$1" = "-rus" ]; then if [ "$1" = "-rus" ] ; then
SET_LANG="Russian" SET_LANG="Russian"
export s_install="1" export s_install="1"
elif [ "$1" = "-eng" ]; then elif [ "$1" = "-eng" ] ; then
SET_LANG="English" SET_LANG="English"
export s_install="1" export s_install="1"
else else
...@@ -47,7 +47,7 @@ else ...@@ -47,7 +47,7 @@ else
--column="Set:" --column "Language:" \ --column="Set:" --column "Language:" \
TRUE "Russian" \ TRUE "Russian" \
FALSE "English" ` 2> /dev/null FALSE "English" ` 2> /dev/null
if [ $? -eq 1 ];then exit 1; fi if [ $? -eq 1 ] ; then exit 1 ; fi
case $SET_LANG in case $SET_LANG in
"Russian") "Russian")
INFO_TEXT="Вы запустили установщик PortWINE ${gamename} версии ${port_ver}. \n\nЭто не коммерческий продукт и развивается исключительно за идею и Ваши пожертвования. \nВсе права сторонего програмного обеспечения принадлежат их владельцам! \nПродолжая установку вы автоматически соглашаетесь с данными условиями." > /dev/null 2>&1 ;; INFO_TEXT="Вы запустили установщик PortWINE ${gamename} версии ${port_ver}. \n\nЭто не коммерческий продукт и развивается исключительно за идею и Ваши пожертвования. \nВсе права сторонего програмного обеспечения принадлежат их владельцам! \nПродолжая установку вы автоматически соглашаетесь с данными условиями." > /dev/null 2>&1 ;;
...@@ -55,10 +55,10 @@ else ...@@ -55,10 +55,10 @@ else
INFO_TEXT="You run the installer PortWINE ${gamename} v. ${port_ver}. \n\nThis is not a commercial product and developed exclusively for the idea and donate. \nAll rights to third-party software belong to their respective owners! \nContinuing the installation of you agree to these terms." > /dev/null 2>&1 ;; INFO_TEXT="You run the installer PortWINE ${gamename} v. ${port_ver}. \n\nThis is not a commercial product and developed exclusively for the idea and donate. \nAll rights to third-party software belong to their respective owners! \nContinuing the installation of you agree to these terms." > /dev/null 2>&1 ;;
esac esac
`zenity --info --title "INFO" --text "$INFO_TEXT" --no-wrap ` 2> /dev/null `zenity --info --title "INFO" --text "$INFO_TEXT" --no-wrap ` 2> /dev/null
if [ $? -eq 1 ];then echo "error" && exit 1; fi if [ $? -eq 1 ] ; then echo "error" && exit 1 ; fi
fi fi
######################################################################## ########################################################################
if [ "${s_install}" = "1" ]; then if [ "${s_install}" = "1" ] ; then
echo "${portname} is installed in ${deflink}" echo "${portname} is installed in ${deflink}"
D_PATH="${deflink}" D_PATH="${deflink}"
else else
...@@ -68,7 +68,7 @@ else ...@@ -68,7 +68,7 @@ else
--column="Выбор" --column "Путь:" \ --column="Выбор" --column "Путь:" \
TRUE "${deflink}" \ TRUE "${deflink}" \
FALSE "Другой путь..." ` 2> /dev/null FALSE "Другой путь..." ` 2> /dev/null
if [ $? -eq 1 ];then exit 1; fi if [ $? -eq 1 ] ; then exit 1 ; fi
case $inst1 in case $inst1 in
"${deflink}") "${deflink}")
D_PATH="${deflink}" ;; D_PATH="${deflink}" ;;
...@@ -90,10 +90,10 @@ else ...@@ -90,10 +90,10 @@ else
D_PATH="${D_PATH}/${portname}" ;; D_PATH="${D_PATH}/${portname}" ;;
esac ;; esac ;;
esac esac
if [ $? -eq 1 ];then echo "error" && exit 1; fi if [ $? -eq 1 ] ; then echo "error" && exit 1 ; fi
fi fi
######################################################################## ########################################################################
if [ "${s_install}" != "1" ]; then if [ "${s_install}" != "1" ] ; then
case $SET_LANG in case $SET_LANG in
"Russian") "Russian")
zen() { zen() {
...@@ -104,16 +104,16 @@ if [ "${s_install}" != "1" ]; then ...@@ -104,16 +104,16 @@ if [ "${s_install}" != "1" ]; then
zenity --progress --title="Install..." --text="Install ${portname}" --pulsate --auto-close --auto-kill --width=450 > /dev/null 2>&1 zenity --progress --title="Install..." --text="Install ${portname}" --pulsate --auto-close --auto-kill --width=450 > /dev/null 2>&1
} ;; } ;;
esac esac
if [ $? -eq 1 ];then echo "error" && exit 1; fi if [ $? -eq 1 ] ; then echo "error" && exit 1 ; fi
fi fi
######################################################################## ########################################################################
export PORT_WINE_PATH="${D_PATH}" export PORT_WINE_PATH="${D_PATH}"
if [ ! -d "${PORT_WINE_PATH}" ];then if [ ! -d "${PORT_WINE_PATH}" ] ; then
mkdir -p "$PORT_WINE_PATH" mkdir -p "$PORT_WINE_PATH"
else else
for CLEAN_PORT in "dist" "dist_dxvk" "dist_vkd3d" "libs" "tmp" for CLEAN_PORT in "dist" "dist_dxvk" "dist_vkd3d" "libs" "tmp"
do do
if [ -d "${PORT_WINE_PATH}/data/${CLEAN_PORT}" ];then if [ -d "${PORT_WINE_PATH}/data/${CLEAN_PORT}" ] ; then
rm -fR "${PORT_WINE_PATH}/data/${CLEAN_PORT}" rm -fR "${PORT_WINE_PATH}/data/${CLEAN_PORT}"
fi fi
done done
...@@ -134,14 +134,14 @@ case $SET_LANG in ...@@ -134,14 +134,14 @@ case $SET_LANG in
"English") "English")
echo "ENG" > "${PORT_WINE_PATH}/data/tmp/${portname}_loc" ;; echo "ENG" > "${PORT_WINE_PATH}/data/tmp/${portname}_loc" ;;
esac esac
if [ $? -eq 1 ];then echo "error" && exit 1; fi if [ $? -eq 1 ] ; then echo "error" && exit 1 ; fi
export PORT_WINE_TMP_PATH="${PORT_WINE_PATH}/data/tmp" export PORT_WINE_TMP_PATH="${PORT_WINE_PATH}/data/tmp"
read "update_loc" < "${PORT_WINE_TMP_PATH}/${portname}_loc" read "update_loc" < "${PORT_WINE_TMP_PATH}/${portname}_loc"
export update_loc=${update_loc} export update_loc=${update_loc}
######################################################################## ########################################################################
cd "${PORT_WINE_PATH}" cd "${PORT_WINE_PATH}"
tail -n +162 "${links}/${setup_script}" > "${PORT_WINE_PATH}/${ARCH_NAME}" tail -n +162 "${links}/${setup_script}" > "${PORT_WINE_PATH}/${ARCH_NAME}"
if [ "${s_install}" = "1" ]; then if [ "${s_install}" = "1" ] ; then
tar -Jxvf "${PORT_WINE_PATH}/${ARCH_NAME}" -C "${PORT_WINE_PATH}/" tar -Jxvf "${PORT_WINE_PATH}/${ARCH_NAME}" -C "${PORT_WINE_PATH}/"
else else
tar -Jxvf "${PORT_WINE_PATH}/${ARCH_NAME}" -C "${PORT_WINE_PATH}/" | zen tar -Jxvf "${PORT_WINE_PATH}/${ARCH_NAME}" -C "${PORT_WINE_PATH}/" | zen
...@@ -150,7 +150,7 @@ chmod 755 -R "${PORT_WINE_PATH}" ...@@ -150,7 +150,7 @@ chmod 755 -R "${PORT_WINE_PATH}"
mv -f "${PORT_WINE_PATH}/${ARCH_NAME}" "${PORT_WINE_PATH}/data/tmp" mv -f "${PORT_WINE_PATH}/${ARCH_NAME}" "${PORT_WINE_PATH}/data/tmp"
sed -n 1,161p "${links}/${setup_script}" > "${PORT_WINE_PATH}/data/tmp/${setup_script}" sed -n 1,161p "${links}/${setup_script}" > "${PORT_WINE_PATH}/data/tmp/${setup_script}"
######################################################################## ########################################################################
if [ -d "${PORT_PFX}_old" ];then if [ -d "${PORT_PFX}_old" ] ; then
rm -fR "${PORT_PFX}" rm -fR "${PORT_PFX}"
mv -f "${PORT_PFX}_old" "${PORT_PFX}" mv -f "${PORT_PFX}_old" "${PORT_PFX}"
fi fi
......
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