Two vesrion wine in portproton

This commit is contained in:
castro-fidel
2020-12-20 01:33:37 +03:00
parent 0c91f18882
commit b7be6dd451
12 changed files with 113 additions and 81 deletions

View File

@ -17,7 +17,7 @@ export port_ver=XX
########################################################################
export PROGS_INST=""
export vexit=0
for PROGS in "wget" "curl" "zenity" "tar"
for PROGS in "wget" "curl" "tar"
do
if [ ! -x "`which "${PROGS}" 2>/dev/null`" ];then
PROGS_INST="${PROGS_INST} ${PROGS}"
@ -36,61 +36,76 @@ 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
########################################################################
SET_LANG=`zenity --title "Install $portname" --text "Select the installation language" --list --radiolist \
if [ "$1" = "-rus" ]; then
SET_LANG="Russian"
export s_install="1"
elif [ "$1" = "-eng" ]; then
SET_LANG="English"
export s_install="1"
else
SET_LANG=`zenity --title "Install $portname" --text "Select the installation language" --list --radiolist \
--column="Set:" --column "Language:" \
TRUE "Russian" \
FALSE "English" ` 2> /dev/null
if [ $? -eq 1 ];then exit 1; fi
case $SET_LANG in
"Russian")
INFO_TEXT="Вы запустили установщик PortWINE ${gamename} версии ${port_ver}. \n\nЭто не коммерческий продукт и развивается исключительно за идею и Ваши пожертвования. \nВсе права сторонего програмного обеспечения принадлежат их владельцам! \nПродолжая установку вы автоматически соглашаетесь с данными условиями." ;;
"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." ;;
esac
`zenity --info --title "INFO" --text "$INFO_TEXT" --no-wrap ` 2> /dev/null
if [ $? -eq 1 ];then echo "error" && exit 1; fi
TRUE "Russian" \
FALSE "English" ` 2> /dev/null
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 ;;
"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 ;;
esac
`zenity --info --title "INFO" --text "$INFO_TEXT" --no-wrap ` 2> /dev/null
if [ $? -eq 1 ];then echo "error" && exit 1; fi
fi
########################################################################
case $SET_LANG in
"Russian")
inst1=`zenity --title "Install ${portname}" --text "Выберите путь для установки (обновления) порта,\nили оставьте его по умолчанию." --list --radiolist --width=350 --height=220 \
--column="Выбор" --column "Путь:" \
TRUE "${deflink}" \
FALSE "Другой путь..." ` 2> /dev/null
if [ $? -eq 1 ];then exit 1; fi
case $inst1 in
"${deflink}")
D_PATH="${deflink}" ;;
"Другой путь...")
D_PATH=`zenity --file-selection --directory --title="Выберите путь..." `
D_PATH="${D_PATH}/${portname}" ;;
esac ;;
"English")
inst1=`zenity --title "Install ${portname}" --text "Select the installation path (update) port,\nor leave it in default." --list --radiolist --width=350 --height=220 \
--column="Set..." --column "Path:" \
TRUE "${deflink}" \
FALSE "Other path..." ` 2> /dev/null
if [ $? -eq 1 ];then exit 1; fi
case $inst1 in
"${deflink}")
D_PATH="${deflink}" ;;
"Other path...")
D_PATH=`zenity --file-selection --directory --title="Select the path..." `
D_PATH="${D_PATH}/${portname}" ;;
esac ;;
esac
if [ $? -eq 1 ];then echo "error" && exit 1; fi
if [ "${s_install}" = "1" ]; then
echo "${portname} is installed in ${deflink}"
D_PATH="${deflink}"
else
case $SET_LANG in
"Russian")
inst1=`zenity --title "Install ${portname}" --text "Выберите путь для установки (обновления) порта,\nили оставьте его по умолчанию." --list --radiolist --width=350 --height=220 \
--column="Выбор" --column "Путь:" \
TRUE "${deflink}" \
FALSE "Другой путь..." ` 2> /dev/null
if [ $? -eq 1 ];then exit 1; fi
case $inst1 in
"${deflink}")
D_PATH="${deflink}" ;;
"Другой путь...")
D_PATH=`zenity --file-selection --directory --title="Выберите путь..." `
D_PATH="${D_PATH}/${portname}" ;;
esac ;;
"English")
inst1=`zenity --title "Install ${portname}" --text "Select the installation path (update) port,\nor leave it in default." --list --radiolist --width=350 --height=220 \
--column="Set..." --column "Path:" \
TRUE "${deflink}" \
FALSE "Other path..." ` 2> /dev/null
if [ $? -eq 1 ];then exit 1; fi
case $inst1 in
"${deflink}")
D_PATH="${deflink}" ;;
"Other path...")
D_PATH=`zenity --file-selection --directory --title="Select the path..." `
D_PATH="${D_PATH}/${portname}" ;;
esac ;;
esac
if [ $? -eq 1 ];then echo "error" && exit 1; fi
fi
########################################################################
case $SET_LANG in
"Russian")
zen() {
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
} ;;
esac
if [ $? -eq 1 ];then echo "error" && exit 1; fi
if [ "${s_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
} ;;
"English")
zen() {
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
fi
########################################################################
export PORT_WINE_PATH="${D_PATH}"
if [ ! -d "${PORT_WINE_PATH}" ];then
@ -128,11 +143,15 @@ read "update_loc" < "${PORT_WINE_TMP_PATH}/${portname}_loc"
export update_loc=${update_loc}
########################################################################
cd "${PORT_WINE_PATH}"
tail -n +168 "${links}/${setup_script}" > "${PORT_WINE_PATH}/${ARCH_NAME}"
tar -Jxvf "${PORT_WINE_PATH}/${ARCH_NAME}" -C "${PORT_WINE_PATH}/" | zen
tail -n +187 "${links}/${setup_script}" > "${PORT_WINE_PATH}/${ARCH_NAME}"
if [ "${s_install}" = "1" ]; then
tar -Jxvf "${PORT_WINE_PATH}/${ARCH_NAME}" -C "${PORT_WINE_PATH}/"
else
tar -Jxvf "${PORT_WINE_PATH}/${ARCH_NAME}" -C "${PORT_WINE_PATH}/" | zen
fi
chmod 755 -R "${PORT_WINE_PATH}"
mv -f "${PORT_WINE_PATH}/${ARCH_NAME}" "${PORT_WINE_PATH}/data/tmp"
sed -n 1,167p "${links}/${setup_script}" > "${PORT_WINE_PATH}/data/tmp/${setup_script}"
sed -n 1,186p "${links}/${setup_script}" > "${PORT_WINE_PATH}/data/tmp/${setup_script}"
########################################################################
if [ -d "${PORT_GAMEDIR}_old" ];then
rm -fR "${PORT_GAMEDIR}"