# --text="There is a new version of RetroDECK on the stable release channel $online_version. Would you like to update to it?\n\n(depending on your internet speed this could takes several minutes).")
# rc=$? # Capture return code, as "Yes" button has no text value
# if [[ $rc == "1" ]]; then # If any button other than "Yes" was clicked
# if [[ $choice == "Ignore this version" ]]; then
# set_setting_value $rd_conf "update_ignore" "$online_version" retrodeck "options" # Store version to ignore for future checks
# fi
# else # User clicked "Yes"
# configurator_generic_dialog "RetroDECK Online Update" "The update process may take several minutes.\n\nAfter the update is complete, RetroDECK will close. When you run it again you will be using the latest version."
--text="There is a new version of RetroDECK on the stable release channel $online_version. Please update through the Discover app!\n\nIf you would like to ignore this version and recieve a notification at the NEXT version,\nclick the \"Ignore this version\" button.")
rc=$?# Capture return code, as "OK" button has no text value
if[[$rc=="1"]];then# If any button other than "OK" was clicked
set_setting_value $rd_conf"update_ignore""$online_version" retrodeck "options"# Store version to ignore for future checks
--text="There is a more recent build of the RetroDECK cooker branch.\nYou are running version $hard_version, the latest is $online_version.\n\nWould you like to update to it?\nIf you would like to skip reminders about this version, click \"Ignore this version\".\nYou will be reminded again at the next version update.\n\nIf you would like to disable these update notifications entirely, disable Online Update Checks in the Configurator.")
rc=$?# Capture return code, as "Yes" button has no text value
if[[$rc=="1"]];then# If any button other than "Yes" was clicked
if[[$choice=="Ignore this version"]];then
set_setting_value $rd_conf"update_ignore""$online_version" retrodeck "options"# Store version to ignore for future checks.
fi
else# User clicked "Yes"
configurator_generic_dialog "RetroDECK Online Update""The update process may take several minutes.\n\nAfter the update is complete, RetroDECK will close. When you run it again you will be using the latest version."
(
locallatest_cooker_download=$(curl --silent https://api.github.com/repos/XargonWan/$update_repo/releases/latest | grep '"browser_download_url":'| sed -E 's/.*"([^"]+)".*/\1/')
flatpak-spawn --host flatpak remove --noninteractive -y net.retrodeck.retrodeck # Remove current version before installing new one, to avoid duplicates
else# Unable to reach the GitHub API for some reason
configurator_generic_dialog "RetroDECK Online Update""RetroDECK is unable to reach the GitHub API to perform a version check.\nIt's possible that location is being blocked by your network or ISP.\n\nIf the problem continues, you will need to disable internal checks through the Configurator\nand perform updates manually through the Discover store."
# This function will determine if a given version number is newer than the one currently read from retrodeck.cfg (which will be the previous running version at update time) and will return "true" if it is
# The given version to check should be in normal RetroDECK version notation of N.N.Nb (eg. 0.8.0b)