From 288f49b6e7ea5de9ecb1ae15e8ed415dd471916b Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Tue, 21 Oct 2025 22:29:08 -0400 Subject: [PATCH] fix(config): create apps.json from default after loading file_apps cfg Previously, would create `apps.json` if it does not exist *before* loading the config for the path it should be at. So it was always created at the default location. This is unnecessary but also confusing as an unused file is created and exists. --- src/config.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/config.cpp b/src/config.cpp index f65102e1752..7f188e80fb8 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -1042,18 +1042,6 @@ namespace config { } void apply_config(std::unordered_map &&vars) { -#ifndef __ANDROID__ - // TODO: Android can possibly support this - if (!fs::exists(stream.file_apps.c_str())) { - fs::copy_file(SUNSHINE_ASSETS_DIR "/apps.json", stream.file_apps); - fs::permissions( - stream.file_apps, - fs::perms::owner_read | fs::perms::owner_write, - fs::perm_options::add - ); - } -#endif - for (auto &[name, val] : vars) { BOOST_LOG(info) << "config: '"sv << name << "' = "sv << val; modified_config_settings[name] = val; @@ -1187,6 +1175,18 @@ namespace config { int_between_f(vars, "wan_encryption_mode", stream.wan_encryption_mode, {0, 2}); path_f(vars, "file_apps", stream.file_apps); +#ifndef __ANDROID__ + // TODO: Android can possibly support this + if (!fs::exists(stream.file_apps.c_str())) { + fs::copy_file(SUNSHINE_ASSETS_DIR "/apps.json", stream.file_apps); + fs::permissions( + stream.file_apps, + fs::perms::owner_read | fs::perms::owner_write, + fs::perm_options::add + ); + } +#endif + int_between_f(vars, "fec_percentage", stream.fec_percentage, {1, 255}); map_int_int_f(vars, "keybindings"s, input.keybindings);