From 7ccd209e38d9fd80cf57048f6db098f98216b7a0 Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Mon, 30 Sep 2024 03:19:15 +0100 Subject: [PATCH 1/2] lang: Don't create global config in `loadLanguage` Don't attempt to save and load the global config in `loadLanguage` unless it exists. Prevents `loadLanguage`, which is called very early, from creating the global config before `setSteamPaths` has a chance to define some paths that are needed to create the global config. Most notably, this fixes Luxtorpeda and Roberta variables from being incorrect when created too early by `loadLanguage`, as this function creates the global config before `setSteamPaths` has a chance to define `STEAMCOMPATOOLS` which is needed in order to build a valid path for `LUXTORPEDACMD` and `ROBERTACMD`. --- steamtinkerlaunch | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index da11d248..b232a286 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -7,7 +7,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20241003-1" +PROGVERS="v14.0.20240930-1 (dont-create-globalconfig-paths-without-steamvars)" PROGCMD="${0##*/}" PROGINTERNALPROTNAME="Proton-stl" SHOSTL="stl" @@ -2696,8 +2696,13 @@ function loadLanguage { writelog "INFO" "${FUNCNAME[0]} - First load the default language '$STLDEFLANG' to make sure all variables are filled" loadLangFile "$STLDEFLANG" - saveCfg "$STLDEFGLOBALCFG" X - loadCfg "$STLDEFGLOBALCFG" X + # Prevents loadLanguage from creating the global.conf too early when it may be missing values + # i.e. loadLanguage may be called before setSteamPaths, which can result in creating paths without the required Steam path variables set yet + # This can happen with Luxtorpead, where the LUXTORPEDACMD may be written out before `setSteamPaths` has been called to set `STEAMCOMPATTOOL` + if [ -f "$STLDEFGLOBALCFG" ]; then + saveCfg "$STLDEFGLOBALCFG" X + loadCfg "$STLDEFGLOBALCFG" X + fi writelog "INFO" "${FUNCNAME[0]} - Loading STLLANG from '$STLDEFGLOBALCFG'" From 10c639391babf398d2d2f43b2bb76965e30fbe32 Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Wed, 2 Oct 2024 20:33:08 +0100 Subject: [PATCH 2/2] version bump --- steamtinkerlaunch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index b232a286..c8305851 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -7,7 +7,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20240930-1 (dont-create-globalconfig-paths-without-steamvars)" +PROGVERS="v14.0.20241003-2" PROGCMD="${0##*/}" PROGINTERNALPROTNAME="Proton-stl" SHOSTL="stl"