Proton Cleanup (#1205)

* Added rsyncing proton-launch.sh and appID.py to xenia and bigpemu so if users delete them accidentally, they have an easy way of getting fresh files.
* Moved resetting ES-DE's settings into its own function so if users reset any of the custom system emulators, they don't also have their settings reset.
    * This was also causing failure in very niche cases where if users didn't have a full suite of ES-DE configs, resetting the config would also fail.
* Cleaned up functions a little for easier maintenance.
* Added detection for old ES-DE installs so resetting config on custom system emulators actually grabs the latest custom systems file.
* Split BigPEmu custom system insertion into atarijaguar and atarijaguarcd
* Adjusted custom systems insertion to be less aggressive (if resetting emulators and not ES-DE, custom systems will be inserted instead of replacing the custom systems file)
This commit is contained in:
rawdatafeel 2024-04-23 11:17:28 -04:00 committed by GitHub
parent b834e149c5
commit 6e4c980f4a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 83 additions and 60 deletions

View file

@ -48,19 +48,38 @@ BigPEmu_init(){
BigPEmu_setEmulationFolder BigPEmu_setEmulationFolder
BigPEmu_setupSaves BigPEmu_setupSaves
BigPEmu_flushEmulatorLauncher BigPEmu_flushEmulatorLauncher
addProtonLaunch
#SRM_createParsers #SRM_createParsers
if [ -e "$ESDE_toolPath" ]; then if [ -e "$ESDE_toolPath" ] || [ -f "${toolsPath}/$ESDE_downloadedToolName" ] || [ -f "${toolsPath}/$ESDE_oldtoolName.AppImage" ]; then
ESDE_junksettingsFile
ESDE_addCustomSystemsFile
BigPEmu_addESConfig BigPEmu_addESConfig
ESDE_setEmulationFolder
else else
echo "ES-DE not found. Skipped adding custom system." echo "ES-DE not found. Skipped adding custom system."
fi fi
} }
#update
BigPEmu_update(){
setMSG "Updating $BigPEmu_emuName settings."
rsync -avhp "$EMUDECKGIT/configs/bigpemu/" "$BigPEmu_appData" --ignore-existing
BigPEmu_setEmulationFolder
BigPEmu_setupSaves
BigPEmu_flushEmulatorLauncher
addProtonLaunch
if [ -e "$ESDE_toolPath" ] || [ -f "${toolsPath}/$ESDE_downloadedToolName" ] || [ -f "${toolsPath}/$ESDE_oldtoolName.AppImage" ]; then
BigPEmu_addESConfig
else
echo "ES-DE not found. Skipped adding custom system."
fi
}
BigPEmu_addESConfig(){ BigPEmu_addESConfig(){
ESDE_junksettingsFile
ESDE_addCustomSystemsFile
ESDE_setEmulationFolder
# Atari Jaguar
if [[ $(grep -rnw "$es_systemsFile" -e 'atarijaguar') == "" ]]; then if [[ $(grep -rnw "$es_systemsFile" -e 'atarijaguar') == "" ]]; then
xmlstarlet ed -S --inplace --subnode '/systemList' --type elem --name 'system' \ xmlstarlet ed -S --inplace --subnode '/systemList' --type elem --name 'system' \
--var newSystem '$prev' \ --var newSystem '$prev' \
@ -81,6 +100,12 @@ BigPEmu_addESConfig(){
-r 'systemList/system/commandM' -v 'command' \ -r 'systemList/system/commandM' -v 'command' \
"$es_systemsFile" "$es_systemsFile"
#format doc to make it look nice
xmlstarlet fo "$es_systemsFile" > "$es_systemsFile".tmp && mv "$es_systemsFile".tmp "$es_systemsFile"
fi
# Atari Jaguar CD
if [[ $(grep -rnw "$es_systemsFile" -e 'atarijaguarcd') == "" ]]; then
xmlstarlet ed -S --inplace --subnode '/systemList' --type elem --name 'system' \ xmlstarlet ed -S --inplace --subnode '/systemList' --type elem --name 'system' \
--var newSystem '$prev' \ --var newSystem '$prev' \
--subnode '$newSystem' --type elem --name 'name' -v 'atarijaguarcd' \ --subnode '$newSystem' --type elem --name 'name' -v 'atarijaguarcd' \
@ -97,24 +122,9 @@ BigPEmu_addESConfig(){
#format doc to make it look nice #format doc to make it look nice
xmlstarlet fo "$es_systemsFile" > "$es_systemsFile".tmp && mv "$es_systemsFile".tmp "$es_systemsFile" xmlstarlet fo "$es_systemsFile" > "$es_systemsFile".tmp && mv "$es_systemsFile".tmp "$es_systemsFile"
fi fi
#Custom Systems config end
}
#update
BigPEmu_update(){ #Custom Systems config end
setMSG "Updating $BigPEmu_emuName settings."
rsync -avhp "$EMUDECKGIT/configs/bigpemu/" "$BigPEmu_appData" --ignore-existing
BigPEmu_setEmulationFolder
BigPEmu_setupSaves
BigPEmu_flushEmulatorLauncher
if [ -e "$ESDE_toolPath" ]; then
ESDE_junksettingsFile
ESDE_addCustomSystemsFile
BigPEmu_addESConfig
ESDE_setEmulationFolder
else
echo "ES-DE not found. Skipped adding custom system."
fi
} }

View file

@ -80,7 +80,8 @@ CemuProton_init(){
#CemuProton_addSteamInputProfile #CemuProton_addSteamInputProfile
CemuProton_addESConfig CemuProton_addESConfig
CemuProton_flushEmulatorLauncher CemuProton_flushEmulatorLauncher
addProtonLaunch
if [ -e "${romsPath}/wiiu/controllerProfiles/controller1.xml" ];then if [ -e "${romsPath}/wiiu/controllerProfiles/controller1.xml" ];then
mv "${romsPath}/wiiu/controllerProfiles/controller1.xml" "${romsPath}/wiiu/controllerProfiles/controller1.xml.bak" mv "${romsPath}/wiiu/controllerProfiles/controller1.xml" "${romsPath}/wiiu/controllerProfiles/controller1.xml.bak"
fi fi
@ -91,11 +92,8 @@ CemuProton_init(){
mv "${romsPath}/wiiu/controllerProfiles/controller3.xml" "${romsPath}/wiiu/controllerProfiles/controller3.xml.bak" mv "${romsPath}/wiiu/controllerProfiles/controller3.xml" "${romsPath}/wiiu/controllerProfiles/controller3.xml.bak"
fi fi
if [ -e "$ESDE_toolPath" ]; then if [ -e "$ESDE_toolPath" ] || [ -f "${toolsPath}/$ESDE_downloadedToolName" ] || [ -f "${toolsPath}/$ESDE_oldtoolName.AppImage" ]; then
ESDE_junksettingsFile
ESDE_addCustomSystemsFile
CemuProton_addESConfig CemuProton_addESConfig
ESDE_setEmulationFolder
else else
echo "ES-DE not found. Skipped adding custom system." echo "ES-DE not found. Skipped adding custom system."
fi fi
@ -110,11 +108,8 @@ CemuProton_update(){
#CemuProton_addSteamInputProfile #CemuProton_addSteamInputProfile
CemuProton_addESConfig CemuProton_addESConfig
CemuProton_flushEmulatorLauncher CemuProton_flushEmulatorLauncher
if [ -e "$ESDE_toolPath" ]; then if [ -e "$ESDE_toolPath" ] || [ -f "${toolsPath}/$ESDE_downloadedToolName" ] || [ -f "${toolsPath}/$ESDE_oldtoolName.AppImage" ]; then
ESDE_junksettingsFile
ESDE_addCustomSystemsFile
CemuProton_addESConfig CemuProton_addESConfig
ESDE_setEmulationFolder
else else
echo "ES-DE not found. Skipped adding custom system." echo "ES-DE not found. Skipped adding custom system."
fi fi
@ -150,6 +145,10 @@ CemuProton_setLanguage(){
CemuProton_addESConfig(){ CemuProton_addESConfig(){
ESDE_junksettingsFile
ESDE_addCustomSystemsFile
ESDE_setEmulationFolder
#insert cemu custom system if it doesn't exist, but the file does #insert cemu custom system if it doesn't exist, but the file does
if [[ $(grep -rnw "$es_systemsFile" -e 'wiiu') == "" ]]; then if [[ $(grep -rnw "$es_systemsFile" -e 'wiiu') == "" ]]; then
xmlstarlet ed -S --inplace --subnode '/systemList' --type elem --name 'system' \ xmlstarlet ed -S --inplace --subnode '/systemList' --type elem --name 'system' \
@ -261,8 +260,6 @@ CemuProton_setResolution(){
} }
CemuProton_flushEmulatorLauncher(){ CemuProton_flushEmulatorLauncher(){
flushEmulatorLaunchers "cemu" flushEmulatorLaunchers "cemu"
}
}

View file

@ -51,11 +51,8 @@ Model2_init(){
#SRM_createParsers #SRM_createParsers
Model2_flushEmulatorLauncher Model2_flushEmulatorLauncher
Model2_addSteamInputProfile Model2_addSteamInputProfile
if [ -e "$ESDE_toolPath" ]; then if [ -e "$ESDE_toolPath" ] || [ -f "${toolsPath}/$ESDE_downloadedToolName" ] || [ -f "${toolsPath}/$ESDE_oldtoolName.AppImage" ]; then
ESDE_junksettingsFile
ESDE_addCustomSystemsFile
Model2_addESConfig Model2_addESConfig
ESDE_setEmulationFolder
else else
echo "ES-DE not found. Skipped adding custom system." echo "ES-DE not found. Skipped adding custom system."
fi fi
@ -65,6 +62,11 @@ Model2_init(){
Model2_addESConfig(){ Model2_addESConfig(){
ESDE_junksettingsFile
ESDE_addCustomSystemsFile
ESDE_setEmulationFolder
if [[ $(grep -rnw "$es_systemsFile" -e 'model2') == "" ]]; then if [[ $(grep -rnw "$es_systemsFile" -e 'model2') == "" ]]; then
xmlstarlet ed -S --inplace --subnode '/systemList' --type elem --name 'system' \ xmlstarlet ed -S --inplace --subnode '/systemList' --type elem --name 'system' \
--var newSystem '$prev' \ --var newSystem '$prev' \

View file

@ -70,11 +70,8 @@ Ryujinx_init(){
#SRM_createParsers #SRM_createParsers
Ryujinx_flushEmulatorLauncher Ryujinx_flushEmulatorLauncher
if [ -e "$ESDE_toolPath" ]; then if [ -e "$ESDE_toolPath" ] || [ -f "${toolsPath}/$ESDE_downloadedToolName" ] || [ -f "${toolsPath}/$ESDE_oldtoolName.AppImage" ]; then
ESDE_junksettingsFile
ESDE_addCustomSystemsFile
Yuzu_addESConfig Yuzu_addESConfig
ESDE_setEmulationFolder
else else
echo "ES-DE not found. Skipped adding custom system." echo "ES-DE not found. Skipped adding custom system."
fi fi
@ -93,11 +90,8 @@ Ryujinx_update(){
Ryujinx_finalize Ryujinx_finalize
Ryujinx_flushEmulatorLauncher Ryujinx_flushEmulatorLauncher
if [ -e "$ESDE_toolPath" ]; then if [ -e "$ESDE_toolPath" ] || [ -f "${toolsPath}/$ESDE_downloadedToolName" ] || [ -f "${toolsPath}/$ESDE_oldtoolName.AppImage" ]; then
ESDE_junksettingsFile
ESDE_addCustomSystemsFile
Yuzu_addESConfig Yuzu_addESConfig
ESDE_setEmulationFolder
else else
echo "ES-DE not found. Skipped adding custom system." echo "ES-DE not found. Skipped adding custom system."
fi fi

View file

@ -69,12 +69,10 @@ Xenia_init(){
#SRM_createParsers #SRM_createParsers
Xenia_cleanESDE Xenia_cleanESDE
Xenia_flushEmulatorLauncher Xenia_flushEmulatorLauncher
addProtonLaunch
if [ -e "$ESDE_toolPath" ]; then
ESDE_junksettingsFile if [ -e "$ESDE_toolPath" ] || [ -f "${toolsPath}/$ESDE_downloadedToolName" ] || [ -f "${toolsPath}/$ESDE_oldtoolName.AppImage" ]; then
ESDE_addCustomSystemsFile
Xenia_addESConfig Xenia_addESConfig
ESDE_setEmulationFolder
else else
echo "ES-DE not found. Skipped adding custom system." echo "ES-DE not found. Skipped adding custom system."
fi fi
@ -82,6 +80,11 @@ Xenia_init(){
} }
Xenia_addESConfig(){ Xenia_addESConfig(){
ESDE_junksettingsFile
ESDE_addCustomSystemsFile
ESDE_setEmulationFolder
if [[ $(grep -rnw "$es_systemsFile" -e 'xbox360') == "" ]]; then if [[ $(grep -rnw "$es_systemsFile" -e 'xbox360') == "" ]]; then
xmlstarlet ed -S --inplace --subnode '/systemList' --type elem --name 'system' \ xmlstarlet ed -S --inplace --subnode '/systemList' --type elem --name 'system' \
--var newSystem '$prev' \ --var newSystem '$prev' \
@ -225,8 +228,6 @@ Xenia_cleanESDE(){
} }
Xenia_flushEmulatorLauncher(){ Xenia_flushEmulatorLauncher(){
flushEmulatorLaunchers "xenia" flushEmulatorLaunchers "xenia"
}
}

View file

@ -97,11 +97,8 @@ Yuzu_init() {
"${toolsPath}/launchers/yuzu.sh" \ "${toolsPath}/launchers/yuzu.sh" \
"False" "False"
if [ -e "$ESDE_toolPath" ]; then if [ -e "$ESDE_toolPath" ] || [ -f "${toolsPath}/$ESDE_downloadedToolName" ] || [ -f "${toolsPath}/$ESDE_oldtoolName.AppImage" ]; then
ESDE_junksettingsFile
ESDE_addCustomSystemsFile
Yuzu_addESConfig Yuzu_addESConfig
ESDE_setEmulationFolder
else else
echo "ES-DE not found. Skipped adding custom system." echo "ES-DE not found. Skipped adding custom system."
fi fi
@ -380,6 +377,11 @@ Yuzu_flushEmulatorLauncher(){
} }
Yuzu_addESConfig(){ Yuzu_addESConfig(){
ESDE_junksettingsFile
ESDE_addCustomSystemsFile
ESDE_setEmulationFolder
if [[ $(grep -rnw "$es_systemsFile" -e 'switch') == "" ]]; then if [[ $(grep -rnw "$es_systemsFile" -e 'switch') == "" ]]; then
xmlstarlet ed -S --inplace --subnode '/systemList' --type elem --name 'system' \ xmlstarlet ed -S --inplace --subnode '/systemList' --type elem --name 'system' \
--var newSystem '$prev' \ --var newSystem '$prev' \

View file

@ -111,13 +111,17 @@ ESDE_init(){
ESDE_addCustomSystemsFile ESDE_addCustomSystemsFile
mkdir -p "$ESDE_newConfigDirectory/settings" mkdir -p "$ESDE_newConfigDirectory/settings"
mkdir -p "$ESDE_newConfigDirectory/custom_systems/"
rsync -avhp --mkpath "$EMUDECKGIT/configs/emulationstation/es_settings.xml" "$(dirname "$es_settingsFile")" --backup --suffix=.bak rsync -avhp --mkpath "$EMUDECKGIT/configs/emulationstation/es_settings.xml" "$(dirname "$es_settingsFile")" --backup --suffix=.bak
rsync -avhp --mkpath "$EMUDECKGIT/chimeraOS/configs/emulationstation/custom_systems/es_find_rules.xml" "$(dirname "$es_rulesFile")" --backup --suffix=.bak rsync -avhp --mkpath "$EMUDECKGIT/chimeraOS/configs/emulationstation/custom_systems/es_find_rules.xml" "$(dirname "$es_rulesFile")" --backup --suffix=.bak
# This duplicates ESDE_addCustomSystemsFile but this line only applies only if you are resetting ES-DE and not the emulators themselves.
rsync -avhp --mkpath "$EMUDECKGIT/configs/emulationstation/custom_systems/es_systems.xml" "$(dirname "$es_systemsFile")" --backup --suffix=.bak
cp -r "$EMUDECKGIT/tools/launchers/es-de/." "$toolsPath/launchers/es-de/" && chmod +x "$toolsPath/launchers/es-de/es-de.sh" cp -r "$EMUDECKGIT/tools/launchers/es-de/." "$toolsPath/launchers/es-de/" && chmod +x "$toolsPath/launchers/es-de/es-de.sh"
ESDE_addCustomSystems ESDE_addCustomSystems
ESDE_setEmulationFolder ESDE_setEmulationFolder
ESDE_setDefaultSettings
ESDE_setDefaultEmulators ESDE_setDefaultEmulators
ESDE_applyTheme "$esdeThemeUrl" "$esdeThemeName" ESDE_applyTheme "$esdeThemeUrl" "$esdeThemeName"
ESDE_migrateDownloadedMedia ESDE_migrateDownloadedMedia
@ -153,9 +157,11 @@ ESDE_update(){
#update es_settings.xml #update es_settings.xml
rsync -avhp --mkpath "$EMUDECKGIT/configs/emulationstation/es_settings.xml" "$(dirname "$es_settingsFile")" --ignore-existing rsync -avhp --mkpath "$EMUDECKGIT/configs/emulationstation/es_settings.xml" "$(dirname "$es_settingsFile")" --ignore-existing
rsync -avhp --mkpath "$EMUDECKGIT/chimeraOS/configs/emulationstation/custom_systems/es_find_rules.xml" "$(dirname "$es_rulesFile")" --ignore-existing rsync -avhp --mkpath "$EMUDECKGIT/chimeraOS/configs/emulationstation/custom_systems/es_find_rules.xml" "$(dirname "$es_rulesFile")" --ignore-existing
rsync -avhp --mkpath "$EMUDECKGIT/configs/emulationstation/custom_systems/es_systems.xml" "$(dirname "$es_systemsFile")" --ignore-existing
ESDE_addCustomSystems ESDE_addCustomSystems
ESDE_setEmulationFolder ESDE_setEmulationFolder
ESDE_setDefaultSettings
ESDE_setDefaultEmulators ESDE_setDefaultEmulators
ESDE_applyTheme "$esdeThemeUrl" "$esdeThemeName" ESDE_applyTheme "$esdeThemeUrl" "$esdeThemeName"
ESDE_migrateDownloadedMedia ESDE_migrateDownloadedMedia
@ -192,7 +198,7 @@ ESDE_addCustomSystemsFile(){
# Separate function so it can be copied and used in the emulator scripts. # Separate function so it can be copied and used in the emulator scripts.
mkdir -p "$ESDE_newConfigDirectory/custom_systems/" mkdir -p "$ESDE_newConfigDirectory/custom_systems/"
rsync -avhp --mkpath "$EMUDECKGIT/configs/emulationstation/custom_systems/es_systems.xml" "$(dirname "$es_systemsFile")" --backup --suffix=.bak rsync -avhp --mkpath "$EMUDECKGIT/configs/emulationstation/custom_systems/es_systems.xml" "$(dirname "$es_systemsFile")" --ignore-existing
} }
@ -360,8 +366,12 @@ ESDE_setEmulationFolder(){
fi fi
fi fi
echo "updating $es_settingsFile" echo "updating $es_settingsFile"
}
ESDE_setDefaultSettings(){
#configure roms Directory #configure roms Directory
esDE_romDir="<string name=\"ROMDirectory\" value=\"${romsPath}\" />" #roms esDE_romDir="<string name=\"ROMDirectory\" value=\"${romsPath}\" />" #roms
@ -380,6 +390,7 @@ ESDE_setEmulationFolder(){
echo "setting ES-DE MediaDirectory to ${esDE_MediaDir}" echo "setting ES-DE MediaDirectory to ${esDE_MediaDir}"
changeLine '<string name="MediaDirectory"' "${esDE_MediaDir}" "$es_settingsFile" changeLine '<string name="MediaDirectory"' "${esDE_MediaDir}" "$es_settingsFile"
fi fi
} }
ESDE_setDefaultEmulators(){ ESDE_setDefaultEmulators(){

View file

@ -932,6 +932,11 @@ isLatestVersionGH() {
fi fi
} }
addProtonLaunch(){
rsync -avhp "$EMUDECKGIT/tools/proton-launch.sh" "${toolsPath}"
rsync -avhp "$EMUDECKGIT/tools/appID.py" "${toolsPath}"
chmod +x "${toolsPath}/proton-launch.sh"
}
function emulatorInit(){ function emulatorInit(){
local emuName=$1 local emuName=$1
@ -1093,4 +1098,5 @@ function controllerLayout_BAYX(){
RetroArch_setBAYXstyle RetroArch_setBAYXstyle
melonDS_setBAYXstyle melonDS_setBAYXstyle
RMG_setBAYXstyle RMG_setBAYXstyle
} }