diff options
| author | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2026-04-18 04:25:18 +0300 |
|---|---|---|
| committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2026-04-20 19:00:11 +0300 |
| commit | 9cdd52df3c166a4cd7c0ac495f0ca435af458503 (patch) | |
| tree | 91672e2395e1ccca2d069494c8a10f5735b38e8d /indra/newview/llvelopack.cpp | |
| parent | bca3449582988d8df40eb8d6d2788e7b9158316b (diff) | |
#5628 Fix setting cleanup on install
Diffstat (limited to 'indra/newview/llvelopack.cpp')
| -rw-r--r-- | indra/newview/llvelopack.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/indra/newview/llvelopack.cpp b/indra/newview/llvelopack.cpp index f1e5c004c6..6a667925b3 100644 --- a/indra/newview/llvelopack.cpp +++ b/indra/newview/llvelopack.cpp @@ -833,6 +833,33 @@ static void on_first_run(void* p_user_data, const char* app_version) MultiByteToWideChar(CP_UTF8, 0, app_version, -1, &version[0], len); register_uninstall_info(install_dir, app_name, version); + + // Drop install related settings + // Unfortunately gDirUtilp is not initialized yet and it's shouldn't + // be possible to change location of the settings. For now it's simpler + // to hardcode the location. + std::optional<std::string> app_data = LLStringUtil::getoptenv("APPDATA"); + if (app_data) + { + // Strip trailing delimiter if present + std::string app_data_path = *app_data; + if (!app_data_path.empty() && (app_data_path.back() == '\\' || app_data_path.back() == '/')) + { + app_data_path.pop_back(); + } + + std::string user_settings_path = app_data_path + "\\SecondLife\\user_settings\\settings.xml"; + LLControlGroup settings("global"); + if (settings.loadFromFile(user_settings_path)) + { + // If user reinstalls or updates, we want to recheck for nsis leftovers. + if (settings.controlExists("PreviousInstallChecked")) + { + settings.setBOOL("PreviousInstallChecked", false); + } + settings.saveToFile(user_settings_path, true); + } + } } static void on_after_install(void* user_data, const char* app_version) |
