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

update setup.sh

parent d9232155
......@@ -2,68 +2,46 @@
# Author: linux-gaming.ru
. "$(dirname $(readlink -f "$0"))/start.sh"
name_desktop="PortProton"
if check_flatpak ; then
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=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"
if check_flatpak
then PW_EXEC="flatpak run ru.linux_gaming.PortProton"
else PW_EXEC="env ${PORT_SCRIPTS_PATH}/start.sh %F"
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
cp -f "${PORT_WINE_PATH}/${name_desktop}.desktop" ${HOME}/.local/share/applications/
cp -f "${PORT_WINE_PATH}/PortProton.desktop" ${HOME}/.local/share/applications/
fi
if grep "SteamOS" "/etc/os-release" &>/dev/null ; then
cp -f "${PORT_WINE_PATH}/${name_desktop}.desktop" "$(xdg-user-dir DESKTOP)"
if grep "SteamOS" "/etc/os-release" &>/dev/null \
|| check_flatpak
then
cp -f "${PORT_WINE_PATH}/PortProton.desktop" "$(xdg-user-dir DESKTOP)"
fi
update-desktop-database -q "${HOME}/.local/share/applications"
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"
fi
name_desktop="readme"
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 "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"
if [[ -f "${HOME}/.local/share/applications/PortProton.desktop" ]] && [[ -f /usr/bin/portproton ]] ; then
try_remove_file "${HOME}/.local/share/applications/PortProton.desktop"
fi
unset INSTALLING_PORT
if [[ "${PW_SILENT_INSTALL}" == 1 ]] ; then
if [[ "${PW_AUTOPLAY}" == 1 ]] ; then
if [[ -f "${HOME}/.local/share/applications/PortProton.desktop" ]] && [[ -f /usr/bin/portproton ]] ; then
try_remove_file "${HOME}/.local/share/applications/PortProton.desktop"
fi
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
echo "Restarting PP after installing..."
export SKIP_CHECK_UPDATES=1
/usr/bin/env bash -c "${PORT_WINE_PATH}/data/scripts/start.sh" $@ &
exit 0
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