diff options
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llappviewerwin32.cpp | 16 | ||||
| -rw-r--r-- | indra/newview/llvelopack.cpp | 27 |
2 files changed, 28 insertions, 15 deletions
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 8f11b219f5..6b26127925 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -447,22 +447,8 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, // commands and exit the process before we do anything else. if (!velopack_initialize()) { + // Obsolete? Always return true // Velopack handled the invocation (install/uninstall hook) - - // Drop install related settings - gDirUtilp->initAppDirs("SecondLife"); - - std::string user_settings_path = gDirUtilp->getExpandedFilename(LL_PATH_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); - } return 0; } #endif 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) |
