Commit ad5f1c6b authored by Mikhail Tergoev's avatar Mikhail Tergoev

added args: --repair

parent 8532a121
...@@ -86,6 +86,8 @@ if ! check_flatpak ; then ...@@ -86,6 +86,8 @@ if ! check_flatpak ; then
echo "${XDG_DATA_HOME}/PortWINE/PortProton" > "${PP_CONFIG_FILE}" echo "${XDG_DATA_HOME}/PortWINE/PortProton" > "${PP_CONFIG_FILE}"
elif [[ -f "${HOME}/PortWINE/PortProton/data/scripts/start.sh" ]] ; then elif [[ -f "${HOME}/PortWINE/PortProton/data/scripts/start.sh" ]] ; then
echo "${HOME}/PortWINE/PortProton" > "${PP_CONFIG_FILE}" echo "${HOME}/PortWINE/PortProton" > "${PP_CONFIG_FILE}"
elif [[ -f "${HOME}/PortProton/data/scripts/start.sh" ]] ; then
echo "${HOME}/PortProton" > "${PP_CONFIG_FILE}"
fi fi
if [[ "$script_path" == "/usr/bin" ]] \ if [[ "$script_path" == "/usr/bin" ]] \
...@@ -93,9 +95,13 @@ if ! check_flatpak ; then ...@@ -93,9 +95,13 @@ if ! check_flatpak ; then
then then
export PORT_WINE_PATH="$(cat "${PP_CONFIG_FILE}" | head -n 1)" export PORT_WINE_PATH="$(cat "${PP_CONFIG_FILE}" | head -n 1)"
if [[ -f "${PORT_WINE_PATH}/data/scripts/start.sh" ]] ; then if [[ -f "${PORT_WINE_PATH}/data/scripts/start.sh" ]] ; then
echo "${port_ver}" > "${PORT_WINE_PATH}/data/tmp/PortProton_ver" if [[ "$1" == "--repair" ]] ; then
/usr/bin/env bash "${PORT_WINE_PATH}/data/scripts/start.sh" "$@" export PORT_WINE_DATA_PATH="${PORT_WINE_PATH}/data"
exit 0 else
echo "${port_ver}" > "${PORT_WINE_PATH}/data/tmp/PortProton_ver"
/usr/bin/env bash "${PORT_WINE_PATH}/data/scripts/start.sh" "$@"
exit 0
fi
else else
rm -f "${PP_CONFIG_FILE}" rm -f "${PP_CONFIG_FILE}"
fi fi
...@@ -104,44 +110,51 @@ else ...@@ -104,44 +110,51 @@ else
if [ "$script_path" == "/app/bin" ] ; then if [ "$script_path" == "/app/bin" ] ; then
export PORT_WINE_PATH="${XDG_DATA_HOME}" export PORT_WINE_PATH="${XDG_DATA_HOME}"
if [ -f "${PORT_WINE_PATH}/scripts/start.sh" ] ; then if [ -f "${PORT_WINE_PATH}/scripts/start.sh" ] ; then
echo "${port_ver}" > "${PORT_WINE_PATH}/tmp/PortProton_ver" if [[ "$1" == "--repair" ]] ; then
/usr/bin/env bash "${PORT_WINE_PATH}/scripts/start.sh" "$@" export PORT_WINE_DATA_PATH="${XDG_DATA_HOME}"
exit 0 else
echo "${port_ver}" > "${PORT_WINE_PATH}/tmp/PortProton_ver"
/usr/bin/env bash "${PORT_WINE_PATH}/scripts/start.sh" "$@"
exit 0
fi
fi fi
fi fi
fi fi
######################################################################## ########################################################################
export PW_SILENT_INSTALL=1
export PW_AUTOPLAY=1 export PW_AUTOPLAY=1
export INSTALLING_PORT=1 export INSTALLING_PORT=1
######################################################################## ########################################################################
if ! check_flatpak ; then if [[ "$1" != "--repair" ]] ; then
inst1=$($yad_gui --title "$loc_install" --text "$loc_choose_path" --list --radiolist \ if ! check_flatpak ; then
--width=600 --height=200 --column="$loc_set" --column "$loc_path" \ inst1=$($yad_gui --title "$loc_install" --text "$loc_choose_path" --list --radiolist \
TRUE "${def_path}" \ --width=600 --height=200 --column="$loc_set" --column "$loc_path" \
FALSE "$loc_other_path") TRUE "${def_path}" \
[ "$?" != "0" ] && exit 1 FALSE "$loc_other_path")
inst1="$(echo $inst1 | awk -F'|' '{print $2}')" [ "$?" != "0" ] && exit 1
case $inst1 in inst1="$(echo $inst1 | awk -F'|' '{print $2}')"
"${def_path}") case $inst1 in
D_PATH="${def_path}" ;; "${def_path}")
"$loc_other_path") D_PATH="${def_path}" ;;
D_PATH="$($yad_gui --file --directory --title="$loc_set_path" --width=800 --height=800)" ;; "$loc_other_path")
esac D_PATH="$($yad_gui --file --directory --title="$loc_set_path" --width=800 --height=800)" ;;
esac
[[ -z "${D_PATH}" ]] && fatal [[ -z "${D_PATH}" ]] && fatal
echo "${D_PATH}" | grep -i "PortProton" 2>/dev/null || D_PATH="${D_PATH}/PortProton" echo "${D_PATH}" | grep -i "PortProton" 2>/dev/null || D_PATH="${D_PATH}/PortProton"
export PORT_WINE_DATA_PATH="${D_PATH}/data" export PORT_WINE_DATA_PATH="${D_PATH}/data"
export PORT_WINE_PATH="${D_PATH}" export PORT_WINE_PATH="${D_PATH}"
if [[ ! -z "$PORT_WINE_PATH" ]] if [[ ! -z "$PORT_WINE_PATH" ]]
then echo "${PORT_WINE_PATH}" > "${PP_CONFIG_FILE}" then echo "${PORT_WINE_PATH}" > "${PP_CONFIG_FILE}"
fi
else
export PORT_WINE_DATA_PATH="${XDG_DATA_HOME}"
fi fi
else
export PORT_WINE_DATA_PATH="${XDG_DATA_HOME}"
fi fi
if [[ ! -d "${PORT_WINE_DATA_PATH}" ]] ; then if [[ ! -d "${PORT_WINE_DATA_PATH}" ]] ; then
mkdir -p "$PORT_WINE_DATA_PATH" || fatal "Cannot create a directory: $PORT_WINE_PATH" mkdir -p "$PORT_WINE_DATA_PATH" || fatal "Cannot create a directory: $PORT_WINE_PATH"
elif [[ "$1" == "--repair" ]] ; then
rm -f "${PORT_WINE_DATA_PATH}/scripts/"* 2>/dev/null
else else
rm -fr "${PORT_WINE_DATA_PATH}/tmp" rm -fr "${PORT_WINE_DATA_PATH}/tmp"
rm -f "${PORT_WINE_DATA_PATH}/scripts/"* 2>/dev/null rm -f "${PORT_WINE_DATA_PATH}/scripts/"* 2>/dev/null
......
...@@ -108,6 +108,13 @@ ...@@ -108,6 +108,13 @@
<content_rating type="oars-1.1"/> <content_rating type="oars-1.1"/>
<releases> <releases>
<release version="1.6.2" date="2024-07-13">
<description>
<ul>
<li>added args: --repair</li>
</ul>
</description>
</release>
<release version="1.6.1" date="2024-05-17"> <release version="1.6.1" date="2024-05-17">
<description> <description>
<ul> <ul>
......
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