forked from CastroFidel/PortWINE
###Scripts version 2012###
This commit is contained in:
97
portwine_install_script/PortNAME-XX → portwine_install_script/PortProton-97
Normal file → Executable file
97
portwine_install_script/PortNAME-XX → portwine_install_script/PortProton-97
Normal file → Executable file
@ -10,19 +10,14 @@ clear && echo '
|
||||
|
||||
'
|
||||
########################################################################
|
||||
export gamedir="PortProton"
|
||||
export gamename="Proton"
|
||||
export portname="PortProton"
|
||||
export port_ver=XX
|
||||
export port_ver=97
|
||||
########################################################################
|
||||
export PW_FTP_URL="https://portwine-linux.ru/ftp"
|
||||
export INSTALLING_PORT=1
|
||||
export PROGS_INST=""
|
||||
export vexit=0
|
||||
export minimum_ldd_ver="2.21"
|
||||
########################################################################
|
||||
for PROGS in "wget" "curl" "tar" "sha256sum" "awk"
|
||||
do
|
||||
for PROGS in "wget" "curl" "tar" "awk" "zenity" "cabextract" ; do
|
||||
if [ ! -x "`which "${PROGS}" 2>/dev/null`" ] ; then
|
||||
PROGS_INST="${PROGS_INST} ${PROGS}" && vexit=1
|
||||
fi
|
||||
@ -31,33 +26,18 @@ if [ "${vexit}" -eq "1" ] ; then
|
||||
echo "You will need to install: ${PROGS_INST}, and restart the script"
|
||||
exit 1
|
||||
fi
|
||||
export local_script_hash=$(sha256sum "$0" | awk '{print $1}')
|
||||
export remote_script_hash=`curl -s --list-only "${PW_FTP_URL}/portwine/${portname}-${port_ver}.sha256sum" | awk '{print $1}'`
|
||||
if [ "${local_script_hash}" != "${remote_script_hash}" ] ; then
|
||||
echo "\033[31mHash sum does not match, please download the ${portname}-${port_ver} again.\033[0m"
|
||||
zenity --error --no-wrap --text "Hash sum does not match, please download the ${portname}-${port_ver} again." 2> /dev/null
|
||||
exit 1
|
||||
fi
|
||||
export system_ldd_ver=`ldd --version | grep -m1 ldd | awk '{print $NF}'`
|
||||
if [ `echo ${system_ldd_ver} | tr -d .` -lt `echo ${minimum_ldd_ver} | tr -d .` ] ; then
|
||||
echo "\033[31mYour system doesn\`t support ${portname}.\nGlibc version required >= ${minimum_ldd_ver}\nGlibc in your system = ${system_ldd_ver}\033[0m"
|
||||
zenity --error --no-wrap --text "Your system doesn\`t support ${portname}.\nGlibc version required >= ${minimum_ldd_ver}\nGlibc in your system = ${system_ldd_ver}" 2> /dev/null
|
||||
exit 1
|
||||
fi
|
||||
########################################################################
|
||||
cd "$(dirname "`readlink -f "$0"`")"
|
||||
links="$(pwd)"
|
||||
setup_script="${portname}"-"${port_ver}"
|
||||
ARCH_NAME="${setup_script}.tar.xz"
|
||||
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
|
||||
########################################################################
|
||||
if [ "$1" = "-rus" ] ; then
|
||||
SET_LANG="Russian"
|
||||
export s_install="1"
|
||||
export silent_install="1"
|
||||
elif [ "$1" = "-eng" ] ; then
|
||||
SET_LANG="English"
|
||||
export s_install="1"
|
||||
export silent_install="1"
|
||||
else
|
||||
SET_LANG=`zenity --title "Install $portname" --text "Select the installation language" --list --radiolist \
|
||||
--column="Set:" --column "Language:" \
|
||||
@ -66,15 +46,15 @@ else
|
||||
if [ $? -eq 1 ] ; then exit 1 ; fi
|
||||
case $SET_LANG in
|
||||
"Russian")
|
||||
INFO_TEXT="Вы запустили установщик PortWINE ${gamename} версии ${port_ver}. \n\nЭто не коммерческий продукт и развивается исключительно за идею и Ваши пожертвования. \nВсе права сторонего програмного обеспечения принадлежат их владельцам! \nПродолжая установку вы автоматически соглашаетесь с данными условиями." > /dev/null 2>&1 ;;
|
||||
INFO_TEXT="Вы запустили установщик PortWINE ${portname} версии ${port_ver}. \n\nЭто не коммерческий продукт и развивается исключительно за идею и Ваши пожертвования. \nВсе права сторонего програмного обеспечения принадлежат их владельцам! \nПродолжая установку вы автоматически соглашаетесь с данными условиями." > /dev/null 2>&1 ;;
|
||||
"English")
|
||||
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 ${portname} 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
|
||||
`zenity --info --title "INFO" --text "$INFO_TEXT" --no-wrap ` 2> /dev/null
|
||||
if [ $? -eq 1 ] ; then echo "error" && exit 1 ; fi
|
||||
fi
|
||||
########################################################################
|
||||
if [ "${s_install}" = "1" ] ; then
|
||||
if [ "${silent_install}" = "1" ] ; then
|
||||
echo "${portname} is installed in ${deflink}"
|
||||
D_PATH="${deflink}"
|
||||
else
|
||||
@ -109,15 +89,15 @@ else
|
||||
if [ $? -eq 1 ] ; then echo "error" && exit 1 ; fi
|
||||
fi
|
||||
########################################################################
|
||||
if [ "${s_install}" != "1" ] ; then
|
||||
if [ "${silent_install}" != "1" ] ; then
|
||||
case $SET_LANG in
|
||||
"Russian")
|
||||
zen() {
|
||||
zenity --progress --title="Установка..." --text="Настройка ${portname}" --pulsate --auto-close --auto-kill --width=450 > /dev/null 2>&1
|
||||
progress_bar() {
|
||||
zenity --progress --title="Установка..." --text="Настройка ${portname}" --pulsate --auto-close --auto-kill --width=450 > /dev/null 2>&1
|
||||
} ;;
|
||||
"English")
|
||||
zen() {
|
||||
zenity --progress --title="Install..." --text="Install ${portname}" --pulsate --auto-close --auto-kill --width=450 > /dev/null 2>&1
|
||||
progress_bar() {
|
||||
zenity --progress --title="Install..." --text="Install ${portname}" --pulsate --auto-close --auto-kill --width=450 > /dev/null 2>&1
|
||||
} ;;
|
||||
esac
|
||||
if [ $? -eq 1 ] ; then echo "error" && exit 1 ; fi
|
||||
@ -127,41 +107,44 @@ export PORT_WINE_PATH="${D_PATH}"
|
||||
if [ ! -d "${PORT_WINE_PATH}" ] ; then
|
||||
mkdir -p "$PORT_WINE_PATH"
|
||||
else
|
||||
for CLEAN_PORT in "dist" "dist_dxvk" "dist_vkd3d" "libs" "tmp"
|
||||
do
|
||||
if [ -d "${PORT_WINE_PATH}/data/${CLEAN_PORT}" ] ; then
|
||||
rm -fR "${PORT_WINE_PATH}/data/${CLEAN_PORT}"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if [ -d "${PORT_WINE_PATH}/data/scripts" ] ; then
|
||||
rm -f "${PORT_WINE_PATH}/data/scripts/"* > /dev/null 2>&1
|
||||
rm -fr "${PORT_WINE_PATH}/data/tmp"
|
||||
rm -f "${PORT_WINE_PATH}/data/scripts/"* > /dev/null 2>&1
|
||||
fi
|
||||
########################################################################
|
||||
mkdir -p "${PORT_WINE_PATH}/data/tmp"
|
||||
echo "${port_ver}" > "${PORT_WINE_PATH}/data/tmp/${portname}_ver"
|
||||
case $SET_LANG in
|
||||
"Russian")
|
||||
echo "RUS" > "${PORT_WINE_PATH}/data/tmp/${portname}_loc" ;;
|
||||
"English")
|
||||
echo "ENG" > "${PORT_WINE_PATH}/data/tmp/${portname}_loc" ;;
|
||||
"Russian") echo "RUS" > "${PORT_WINE_PATH}/data/tmp/${portname}_loc" ;;
|
||||
"English") echo "ENG" > "${PORT_WINE_PATH}/data/tmp/${portname}_loc" ;;
|
||||
esac
|
||||
if [ $? -eq 1 ] ; then echo "error" && exit 1 ; fi
|
||||
export PORT_WINE_TMP_PATH="${PORT_WINE_PATH}/data/tmp"
|
||||
read "update_loc" < "${PORT_WINE_TMP_PATH}/${portname}_loc"
|
||||
export update_loc=${update_loc}
|
||||
########################################################################
|
||||
cd "${PORT_WINE_PATH}"
|
||||
tail -n +169 "${links}/${setup_script}" > "${PORT_WINE_PATH}/${ARCH_NAME}"
|
||||
if [ "${s_install}" = "1" ] ; then
|
||||
tar -Jxvf "${PORT_WINE_PATH}/${ARCH_NAME}" -C "${PORT_WINE_PATH}/"
|
||||
export PORT_WINE_TMP_PATH="${PORT_WINE_PATH}/data/tmp"
|
||||
cd "${PORT_WINE_PATH}"
|
||||
try_download_scripts () {
|
||||
wget -c -t 5 -T 20 "https://github.com/Castro-Fidel/PortWINE/archive/refs/heads/master.tar.gz" --output-document="${PORT_WINE_TMP_PATH}/PortWINE-master.tar.gz"
|
||||
if [ "$?" = "0" ] ; then
|
||||
tar -xvzf "${PORT_WINE_TMP_PATH}/PortWINE-master.tar.gz" -C "${PORT_WINE_TMP_PATH}"
|
||||
if [ "$?" = "0" ] ; then
|
||||
[ ! -d "${PORT_WINE_PATH}/data/" ] && mkdir "${PORT_WINE_PATH}/data/"
|
||||
cp -fr "${PORT_WINE_TMP_PATH}/PortWINE-master/data_from_portwine/"* "${PORT_WINE_PATH}/data/"
|
||||
rm -f "${PORT_WINE_TMP_PATH}/PortWINE-master.tar.gz"
|
||||
rm -fr "${PORT_WINE_TMP_PATH}/PortWINE-master/"
|
||||
export scripts_current_ver=`cat "${PORT_WINE_PATH}/data/scripts/var" | grep SCRIPTS_NEXT_VERSION | awk -F "=" '{print $2}'`
|
||||
echo "${scripts_current_ver}" > "${PORT_WINE_TMP_PATH}/scripts_ver"
|
||||
else
|
||||
rm -f "${PORT_WINE_TMP_PATH}/PortWINE-master.tar.gz"
|
||||
try_download_scripts
|
||||
fi
|
||||
else
|
||||
try_download_scripts
|
||||
fi
|
||||
}
|
||||
if [ "${silent_install}" = "1" ] ; then
|
||||
try_download_scripts
|
||||
else
|
||||
tar -Jxvf "${PORT_WINE_PATH}/${ARCH_NAME}" -C "${PORT_WINE_PATH}/" | zen
|
||||
try_download_scripts | progress_bar
|
||||
fi
|
||||
chmod 755 -R "${PORT_WINE_PATH}"
|
||||
mv -f "${PORT_WINE_PATH}/${ARCH_NAME}" "${PORT_WINE_PATH}/data/tmp"
|
||||
sed -n 1,168p "${links}/${setup_script}" > "${PORT_WINE_PATH}/data/tmp/${setup_script}"
|
||||
echo "${portname}" > "${PORT_WINE_PATH}/data/tmp/portname"
|
||||
########################################################################
|
||||
cd "${PORT_WINE_PATH}/data/scripts"
|
||||
/bin/bash -c "${PORT_WINE_PATH}/data/scripts/setup.sh" && exit 0
|
Reference in New Issue
Block a user