Plan for upcomfing SteamOS SD card path changes

This commit is contained in:
icenine451 2022-12-22 10:34:50 -05:00
parent 71f209eb7a
commit 3bc51e3c02
4 changed files with 25 additions and 15 deletions

View file

@ -29,10 +29,10 @@ browse() {
fi fi
else else
zenity --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" --cancel-label="No" --ok-label "Yes" \ zenity --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" --cancel-label="No" --ok-label "Yes" \
--text="No directory selected. Do you want to return to the main menu?" --text="No directory selected. Do you want to exit?"
if [ $? == 1 ] if [ $? == 0 ]
then then
configurator_welcome_dialog break
fi fi
fi fi
done done

View file

@ -68,6 +68,12 @@ then
fi fi
fi fi
# Check if SD card path has changed from SteamOS update
if [[ ! -d $default_sd && "$(ls -A /run/media/deck/)" ]]; then
configurator_generic_dialog "The SD card was not found in the expected location.\nThis may happen when SteamOS is updated.\n\nPlease browse to the current location of the SD card.\n\nIf you are not using an SD card, please click \"Cancel\"."
default_sd=$(browse "SD Card Location")
fi
rdhome="$HOME/retrodeck" # the retrodeck home, aka ~/retrodeck rdhome="$HOME/retrodeck" # the retrodeck home, aka ~/retrodeck
roms_folder="$rdhome/roms" # the default roms folder path roms_folder="$rdhome/roms" # the default roms folder path
saves_folder="$rdhome/saves" # the default saves folder path saves_folder="$rdhome/saves" # the default saves folder path
@ -97,4 +103,12 @@ else
echo "Found RetroDECK config file in $rd_conf" echo "Found RetroDECK config file in $rd_conf"
echo "Loading it" echo "Loading it"
source "$rd_conf" source "$rd_conf"
# Update SD card path if changed from SteamOS update
if [[ ! -d $sdcard && "$(ls -A /run/media/deck/)" ]]; then
configurator_generic_dialog "The SD card was not found in the expected location.\nThis may happen when SteamOS is updated.\n\nPlease browse to the current location of the SD card.\n\nIf you are not using an SD card, please click \"Cancel\"."
sdcard=$(browse "SD Card Location")
conf_write
source "$rd_conf"
fi
fi fi

View file

@ -7,7 +7,7 @@ post_update() {
local prev_version=$(sed -e 's/[\.a-z]//g' <<< $version) local prev_version=$(sed -e 's/[\.a-z]//g' <<< $version)
if [[ $prev_version -le "054" ]]; then if [[ $prev_version -le "054" ]]; then # If updating from prior to save sorting change
# Finding existing ROMs folder # Finding existing ROMs folder
if [ -d "$default_sd/retrodeck" ] if [ -d "$default_sd/retrodeck" ]

View file

@ -83,15 +83,11 @@ else
finit # Executing First/Force init finit # Executing First/Force init
fi fi
# Normal Startup # Check if SD card path has changed from SteamOS update
if [[ ! -d $sd_card && "$(ls -A /run/media/deck/)" ]]; then
# Check if the retrodeck folder is existing configurator_generic_dialog "The ROMs folder was not found in the expected location.\nThis may happen when SteamOS is updated.\n\nPlease browse to the current location of the "
if [ ! -d $rdhome ] then
zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK" \
--text="The retrodeck folder was not found on the previous location, please choose a new location.\nNOTE: the folder selection may work on desktop mode only."
configurator_destination_choice_dialog()
fi fi
# Normal Startup
start_retrodeck start_retrodeck