Commit fb933afd authored by Mikhail Tergoev's avatar Mikhail Tergoev

PortProton_v1.0

parent 9f5c39ec
......@@ -2,6 +2,9 @@
-----------------------------------------
История изменений:
###Scripts version 2091###
* RELEASE PORTPROTON v.1.0
###Scripts version 2090###
* HOTFIX - исправлено создание символьных ссылок
......
......@@ -74,10 +74,10 @@ try_force_link_file () {
export -f try_force_link_file
check_symlink () {
CHK_SYMLINK_FILE=`file "$1"`
if [ ! -z `echo "$CHK_SYMLINK_FILE" | grep -v "broken" | grep "symbolic link to" | awk '{print $1}'` ] ; then
CHK_SYMLINK_FILE="`file "$1"`"
if [[ ! -z "`echo "$CHK_SYMLINK_FILE" | grep -v "broken" | grep "symbolic link to" | awk '{print $1}'`" ]] ; then
return 0
elif [ ! -z `echo "$CHK_SYMLINK_FILE" | grep "broken symbolic link to" | awk '{print $1}'` ] ; then
elif [[ ! -z "`echo "$CHK_SYMLINK_FILE" | grep "broken symbolic link to" | awk '{print $1}'`" ]] ; then
print_error "remove broken symlink: $CHK_SYMLINK_FILE"
rm -fr "$CHK_SYMLINK_FILE"
return 1
......@@ -226,37 +226,37 @@ pw_vkbasalt_check () {
}
pw_clear_pfx () {
try_remove_file "${WINEPREFIX}/system.reg"
try_remove_file "${WINEPREFIX}/user.reg"
try_remove_file "${WINEPREFIX}/userdef.reg"
try_remove_file "${WINEPREFIX}/winetricks.log"
try_remove_file "${WINEPREFIX}/.update-timestamp"
try_remove_file "${WINEPREFIX}/drive_c/.windows-serial"
try_remove_dir "${WINEPREFIX}/drive_c/windows/"
try_remove_dir "${WINEPREFIX}/drive_c/ProgramData/Setup"
try_remove_dir "${WINEPREFIX}/drive_c/ProgramData/Windows"
try_remove_dir "${WINEPREFIX}/drive_c/ProgramData/WindowsTask"
try_remove_dir "${WINEPREFIX}/drive_c/ProgramData/Package Cache"
try_remove_dir "${WINEPREFIX}/drive_c/users/Public/Local Settings/Application Data/Microsoft"
try_remove_dir "${WINEPREFIX}/drive_c/users/Public/Local Settings/Application Data/Temp"
try_remove_dir "${WINEPREFIX}/drive_c/users/Public/Local Settings/Temporary Internet Files"
try_remove_dir "${WINEPREFIX}/drive_c/users/Public/Application Data/Microsoft"
try_remove_dir "${WINEPREFIX}/drive_c/users/Public/Application Data/wine_gecko"
try_remove_dir "${WINEPREFIX}/drive_c/users/Public/Temp"
try_remove_dir "${WINEPREFIX}/drive_c/users/steamuser/Local Settings/Application Data/Microsoft"
try_remove_dir "${WINEPREFIX}/drive_c/users/steamuser/Local Settings/Application Data/Temp"
try_remove_dir "${WINEPREFIX}/drive_c/users/steamuser/Local Settings/Temporary Internet Files"
try_remove_dir "${WINEPREFIX}/drive_c/users/steamuser/Application Data/Microsoft"
try_remove_dir "${WINEPREFIX}/drive_c/users/steamuser/Application Data/wine_gecko"
try_remove_dir "${WINEPREFIX}/drive_c/users/steamuser/Temp"
try_remove_dir "${WINEPREFIX}/drive_c/Program Files/Internet Explorer"
try_remove_dir "${WINEPREFIX}/drive_c/Program Files/Windows Media Player"
try_remove_dir "${WINEPREFIX}/drive_c/Program Files/Windows NT"
try_remove_dir "${WINEPREFIX}/drive_c/Program Files/Common Files"
try_remove_dir "${WINEPREFIX}/drive_c/Program Files (x86)/Internet Explorer"
try_remove_dir "${WINEPREFIX}/drive_c/Program Files (x86)/Common Files"
try_remove_dir "${WINEPREFIX}/drive_c/Program Files (x86)/Windows Media Player"
try_remove_dir "${WINEPREFIX}/drive_c/Program Files (x86)/Windows NT"
try_remove_file "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/system.reg"
try_remove_file "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/user.reg"
try_remove_file "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/userdef.reg"
try_remove_file "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/winetricks.log"
try_remove_file "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/.update-timestamp"
try_remove_file "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/.windows-serial"
try_remove_dir "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/windows/"
try_remove_dir "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/ProgramData/Setup"
try_remove_dir "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/ProgramData/Windows"
try_remove_dir "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/ProgramData/WindowsTask"
try_remove_dir "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/ProgramData/Package Cache"
try_remove_dir "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/users/Public/Local Settings/Application Data/Microsoft"
try_remove_dir "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/users/Public/Local Settings/Application Data/Temp"
try_remove_dir "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/users/Public/Local Settings/Temporary Internet Files"
try_remove_dir "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/users/Public/Application Data/Microsoft"
try_remove_dir "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/users/Public/Application Data/wine_gecko"
try_remove_dir "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/users/Public/Temp"
try_remove_dir "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/users/steamuser/Local Settings/Application Data/Microsoft"
try_remove_dir "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/users/steamuser/Local Settings/Application Data/Temp"
try_remove_dir "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/users/steamuser/Local Settings/Temporary Internet Files"
try_remove_dir "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/users/steamuser/Application Data/Microsoft"
try_remove_dir "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/users/steamuser/Application Data/wine_gecko"
try_remove_dir "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/users/steamuser/Temp"
try_remove_dir "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/Program Files/Internet Explorer"
try_remove_dir "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/Program Files/Windows Media Player"
try_remove_dir "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/Program Files/Windows NT"
try_remove_dir "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/Program Files/Common Files"
try_remove_dir "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/Program Files (x86)/Internet Explorer"
try_remove_dir "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/Program Files (x86)/Common Files"
try_remove_dir "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/Program Files (x86)/Windows Media Player"
try_remove_dir "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/Program Files (x86)/Windows NT"
try_remove_dir "${PORT_WINE_TMP_PATH}/mesa_shader_cache"
rm -f "${PORT_WINE_TMP_PATH}"/*.bin
rm -f "${PORT_WINE_TMP_PATH}"/*.foz
......@@ -331,13 +331,17 @@ init_wine_ver () {
done
for mono_gecko_chk in "mono" "gecko" ; do
if [ ! -d "${WINEDIR}/share/wine/${mono_gecko_chk}" ] ; then
if check_symlink "${WINEDIR}/share/wine/${mono_gecko_chk}" ; then
echo "${WINEDIR}/share/wine/${mono_gecko_chk} is symlink. OK."
elif [[ -d "${WINEDIR}/share/wine/${mono_gecko_chk}" ]] ; then
try_copy_dir "${WINEDIR}/share/wine/${mono_gecko_chk}" "${PORT_WINE_TMP_PATH}"
try_remove_dir "${WINEDIR}/share/wine/${mono_gecko_chk}"
try_force_link_dir "${PORT_WINE_TMP_PATH}/${mono_gecko_chk}" "${WINEDIR}"/share/wine/
elif ! check_symlink "${WINEDIR}/share/wine/${mono_gecko_chk}" && [[ -d "${WINEDIR}/share/wine/${mono_gecko_chk}" ]] ; then
cp -fr "${WINEDIR}/share/wine/${mono_gecko_chk}" "${PORT_WINE_TMP_PATH}"
rm -fr "${WINEDIR}/share/wine/${mono_gecko_chk}"
try_force_link_dir "${PORT_WINE_TMP_PATH}/${mono_gecko_chk}" "${WINEDIR}"/share/wine/
echo "Copy ${WINEDIR}/share/wine/${mono_gecko_chk} to tmp and create symlink to ${WINEDIR}/share/wine/. OK."
else
try_remove_dir "${WINEDIR}/share/wine/${mono_gecko_chk}"
try_force_link_dir "${PORT_WINE_TMP_PATH}/${mono_gecko_chk}" "${WINEDIR}"/share/wine
echo "${WINEDIR}/share/wine/${mono_gecko_chk} is broken symlink. Repair... OK."
fi
done
fi
......@@ -414,8 +418,8 @@ pw_kill_autostart () {
fi
done
fi
if [[ ! -z "`ls "${WINEPREFIX}"/drive_c/ | grep -m 1 ".tmp"`" ]] ; then
rm -f "${WINEPREFIX}"/drive_c/*.tmp
if [[ ! -z "`ls "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}"/drive_c/ | grep -m 1 ".tmp"`" ]] ; then
rm -f "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}"/drive_c/*.tmp
fi
return 0
}
......@@ -433,7 +437,7 @@ stop_portwine () {
try_remove_file "${PORT_SCRIPTS_PATH}/1"
kill_portwine &&
try_remove_dir "${PW_WINELIB}/var"
find "${WINEPREFIX}/drive_c/" -maxdepth 1 -type f -name "*.tmp" -delete
find "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/" -maxdepth 1 -type f -name "*.tmp" -delete
if [ ! -z "`pgrep -a yad_new | grep "\-\-notification" | awk '{print $1}'`" ] ; then
kill -s SIGUSR1 "`pgrep -a yad_new | grep "\-\-notification" | awk '{print $1}'`"
fi
......
......@@ -209,7 +209,7 @@ pw_winefile () {
pw_winecmd () {
export PW_USE_TERMINAL=1
start_portwine
cd "${WINEPREFIX}/drive_c"
cd "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c"
${pw_runtime} env LD_LIBRARY_PATH="${PW_LD_LIBRARY_PATH}" xterm -e "${WINELOADER}" cmd
stop_portwine
}
......
#!/bin/env bash
#Author: Castro-Fidel (PortWINE-Linux.ru)
#SCRIPTS_NEXT_VERSION=2090
#SCRIPTS_NEXT_VERSION=2091
#PORT_NEXT_VERSION=97
########################################################################
export PW_MANGOHUD=1
......
......@@ -4,7 +4,7 @@
########################################################################
unset PW_AUTOPLAY PW_SET_LANG PW_SILENT_INSTALL
export portname="PortProton"
export port_ver=97
export port_ver=1.0
########################################################################
deflink="${HOME}/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
......
#!/usr/bin/env bash
# Author: Castro-Fidel (PortWINE-Linux.ru)
# License MIT
########################################################################
unset PW_AUTOPLAY PW_SET_LANG PW_SILENT_INSTALL
export portname="PortProton"
export port_ver=1.0
########################################################################
deflink="${HOME}/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 [ "$(dirname "`readlink -f "$0"`")" == "/usr/bin" ] ; then
[ -z "${XDG_DATA_HOME}" ] && export XDG_DATA_HOME="$HOME/.local/share"
if [ -f "${XDG_DATA_HOME}/PortWINE/PortProton/data/scripts/start.sh" ] ; then
/usr/bin/env bash "${XDG_DATA_HOME}/PortWINE/PortProton/data/scripts/start.sh" "$@"
exit 0
else
if [ ! -z "`locale | grep "LANG=ru_RU.UTF-8"`" ] ; then
PW_SET_LANG="Russian"
else
PW_SET_LANG="English"
fi
export PW_SILENT_INSTALL="1"
export PW_AUTOPLAY=1
deflink="${XDG_DATA_HOME}/PortWINE/${portname}"
fi
fi
########################################################################
export INSTALLING_PORT=1
export PROGS_INST=""
export vexit=0
########################################################################
for PROGS in "wget" "curl" "tar" "awk" "zenity" "cabextract" "pidof" ; do
if [ ! -x "`which "${PROGS}" 2>/dev/null`" ] ; then
PROGS_INST="${PROGS_INST} ${PROGS}" && vexit=1
fi
done
if [ "${vexit}" -eq "1" ] ; then
echo "You will need to install: ${PROGS_INST}, and restart the script"
exit 1
fi
########################################################################
cd "$(dirname "`readlink -f "$0"`")"
links="$(pwd)"
########################################################################
if [ "$1" = "-rus" ] ; then
PW_SET_LANG="Russian"
export PW_SILENT_INSTALL="1"
elif [ "$1" = "-eng" ] ; then
PW_SET_LANG="English"
export PW_SILENT_INSTALL="1"
elif [ -z "${PW_SET_LANG}" ] ; then
PW_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 $PW_SET_LANG in
"Russian")
INFO_TEXT="Вы запустили установщик PortWINE ${portname} версии ${port_ver}. \n\nЭто не коммерческий продукт и развивается исключительно за идею и Ваши пожертвования. \nВсе права сторонего програмного обеспечения принадлежат их владельцам! \nПродолжая установку вы автоматически соглашаетесь с данными условиями." > /dev/null 2>&1 ;;
"English")
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 [ "${PW_SILENT_INSTALL}" = "1" ] ; then
echo "${portname} is installed in ${deflink}"
D_PATH="${deflink}"
else
case $PW_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 $PW_SET_LANG in
"Russian")
progress_bar() {
zenity --progress --title="Установка..." --text="Настройка ${portname}" --pulsate --auto-close --auto-kill --width=450 > /dev/null 2>&1
} ;;
"English")
progress_bar() {
zenity --progress --title="Install..." --text="Install ${portname}" --pulsate --auto-close --auto-kill --width=450 > /dev/null 2>&1
} ;;
esac
########################################################################
export PORT_WINE_PATH="${D_PATH}"
if [ ! -d "${PORT_WINE_PATH}" ] ; then
mkdir -p "$PORT_WINE_PATH"
else
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 $PW_SET_LANG in
"Russian") echo "RUS" > "${PORT_WINE_PATH}/data/tmp/${portname}_loc" ;;
"English") echo "ENG" > "${PORT_WINE_PATH}/data/tmp/${portname}_loc" ;;
esac
########################################################################
export PORT_WINE_TMP_PATH="${PORT_WINE_PATH}/data/tmp"
cd "${PORT_WINE_PATH}"
try_download_scripts () {
wget -O "${PORT_WINE_TMP_PATH}/PortWINE-master.tar.gz" -nd -c --read-timeout 300 \
--retry-connrefused --timeout 15 --tries 3 \
--user-agent="Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)" \
"https://github.com/Castro-Fidel/PortWINE/archive/refs/heads/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 [ "${PW_SILENT_INSTALL}" = "1" ] & [ ! -f "/usr/bin/portproton" ] ; then
try_download_scripts
else
try_download_scripts | progress_bar
fi
chmod 755 -R "${PORT_WINE_PATH}"
########################################################################
cd "${PORT_WINE_PATH}/data/scripts"
/usr/bin/env bash "${PORT_WINE_PATH}/data/scripts/setup.sh" && exit 0
################################ARCH_BIN################################
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