Commit 20ac7934 authored by Mikhail Tergoev's avatar Mikhail Tergoev

update setup.sh

parent d9232155
...@@ -2,68 +2,46 @@ ...@@ -2,68 +2,46 @@
# Author: linux-gaming.ru # Author: linux-gaming.ru
. "$(dirname $(readlink -f "$0"))/start.sh" . "$(dirname $(readlink -f "$0"))/start.sh"
name_desktop="PortProton" if check_flatpak
if check_flatpak ; then then PW_EXEC="flatpak run ru.linux_gaming.PortProton"
echo "[Desktop Entry]" > "${PORT_WINE_PATH}/${name_desktop}.desktop" else PW_EXEC="env ${PORT_SCRIPTS_PATH}/start.sh %F"
echo "Name=${name_desktop}" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
echo "Version=${install_ver}" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
echo "Exec=flatpak run ru.linux_gaming.PortProton" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
echo "Type=Application" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
echo "Terminal=False" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
echo "Categories=Game" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
echo "StartupNotify=true" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
echo "MimeType=application/x-ms-dos-executable;application/x-wine-extension-msp;application/x-msi;application/x-msdos-program" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
echo "Path="${PORT_SCRIPTS_PATH}/"" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
echo "Icon="${PORT_WINE_PATH}/data/img/w.png"" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
chmod u+x "${PORT_WINE_PATH}/${name_desktop}.desktop"
else
echo "[Desktop Entry]" > "${PORT_WINE_PATH}/${name_desktop}.desktop"
echo "Name=${name_desktop}" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
echo "Version=${install_ver}" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
echo "Exec=env "${PORT_SCRIPTS_PATH}/start.sh %F"" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
echo "Type=Application" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
echo "Terminal=False" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
echo "Categories=Game" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
echo "StartupNotify=true" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
echo "MimeType=application/x-ms-dos-executable;application/x-wine-extension-msp;application/x-msi;application/x-msdos-program" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
echo "Path="${PORT_SCRIPTS_PATH}/"" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
echo "Icon="${PORT_WINE_PATH}/data/img/w.png"" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
chmod u+x "${PORT_WINE_PATH}/${name_desktop}.desktop"
fi fi
echo "[Desktop Entry]" > "${PORT_WINE_PATH}/PortProton.desktop"
echo "Name=PortProton" >> "${PORT_WINE_PATH}/PortProton.desktop"
echo "Version=${install_ver}" >> "${PORT_WINE_PATH}/PortProton.desktop"
echo "Exec=$PW_EXEC" >> "${PORT_WINE_PATH}/PortProton.desktop"
echo "Type=Application" >> "${PORT_WINE_PATH}/PortProton.desktop"
echo "Terminal=False" >> "${PORT_WINE_PATH}/PortProton.desktop"
echo "Categories=Game" >> "${PORT_WINE_PATH}/PortProton.desktop"
echo "StartupNotify=true" >> "${PORT_WINE_PATH}/PortProton.desktop"
echo "MimeType=application/x-ms-dos-executable;application/x-wine-extension-msp;application/x-msi;application/x-msdos-program" >> "${PORT_WINE_PATH}/PortProton.desktop"
echo "Path="${PORT_SCRIPTS_PATH}/"" >> "${PORT_WINE_PATH}/PortProton.desktop"
echo "Icon="${PORT_WINE_PATH}/data/img/w.png"" >> "${PORT_WINE_PATH}/PortProton.desktop"
chmod u+x "${PORT_WINE_PATH}/PortProton.desktop"
if [[ ! -f /usr/bin/portproton ]] && ! check_flatpak ; then if [[ ! -f /usr/bin/portproton ]] && ! check_flatpak ; then
cp -f "${PORT_WINE_PATH}/${name_desktop}.desktop" ${HOME}/.local/share/applications/ cp -f "${PORT_WINE_PATH}/PortProton.desktop" ${HOME}/.local/share/applications/
fi fi
if grep "SteamOS" "/etc/os-release" &>/dev/null ; then if grep "SteamOS" "/etc/os-release" &>/dev/null \
cp -f "${PORT_WINE_PATH}/${name_desktop}.desktop" "$(xdg-user-dir DESKTOP)" || check_flatpak
then
cp -f "${PORT_WINE_PATH}/PortProton.desktop" "$(xdg-user-dir DESKTOP)"
fi fi
update-desktop-database -q "${HOME}/.local/share/applications"
if ! check_flatpak ; then if ! check_flatpak ; then
update-desktop-database -q "${HOME}/.local/share/applications"
xdg-mime default PortProton.desktop "application/x-ms-dos-executable;application/x-wine-extension-msp;application/x-msi;application/x-msdos-program" xdg-mime default PortProton.desktop "application/x-ms-dos-executable;application/x-wine-extension-msp;application/x-msi;application/x-msdos-program"
fi fi
name_desktop="readme" if [[ -f "${HOME}/.local/share/applications/PortProton.desktop" ]] && [[ -f /usr/bin/portproton ]] ; then
echo "[Desktop Entry]" > "${PORT_WINE_PATH}/${name_desktop}.desktop" try_remove_file "${HOME}/.local/share/applications/PortProton.desktop"
echo "Name=${name_desktop}" >> "${PORT_WINE_PATH}/${name_desktop}.desktop" fi
echo "Version=${install_ver}" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
echo "Type=Link" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
echo "Icon="${PORT_WINE_PATH}/data/img/readme.png"" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
echo "URL=${urlg}" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
chmod u+x "${PORT_WINE_PATH}/${name_desktop}.desktop"
unset INSTALLING_PORT unset INSTALLING_PORT
if [[ "${PW_SILENT_INSTALL}" == 1 ]] ; then
if [[ "${PW_AUTOPLAY}" == 1 ]] ; then echo "Restarting PP after installing..."
if [[ -f "${HOME}/.local/share/applications/PortProton.desktop" ]] && [[ -f /usr/bin/portproton ]] ; then export SKIP_CHECK_UPDATES=1
try_remove_file "${HOME}/.local/share/applications/PortProton.desktop" /usr/bin/env bash -c "${PORT_WINE_PATH}/data/scripts/start.sh" $@ &
fi exit 0
echo "Restarting PP after installing..."
/usr/bin/env bash -c "${PORT_WINE_PATH}/data/scripts/start.sh" $@ &
exit 0
else
echo "Installation completed successfully."
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