From 556728c04a5cfb82ed4f7bd19b9b25b101e127c3 Mon Sep 17 00:00:00 2001 From: Carbon Cowboy <254348425+carboncowboy@users.noreply.github.com> Date: Mon, 2 Feb 2026 17:18:45 -0800 Subject: Improve windir detection in LLDir::openDir --- indra/llfilesystem/lldir.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/indra/llfilesystem/lldir.cpp b/indra/llfilesystem/lldir.cpp index 7d547ca4be..22bb50074a 100644 --- a/indra/llfilesystem/lldir.cpp +++ b/indra/llfilesystem/lldir.cpp @@ -1116,7 +1116,16 @@ void LLDir::openDir(const std::string& filepath) #if LL_WINDOWS // Windows: Use explorer.exe with /select flag to highlight the file - std::string system_root = LLStringUtil::getenv("SystemRoot", "C:\\Windows"); + std::string system_root = LLStringUtil::getenv("SystemRoot"); + if (system_root.empty()) + { + system_root = LLStringUtil::getenv("WINDIR"); + } + if (system_root.empty()) + { + LL_WARNS() << "Neither SystemRoot nor WINDIR environment variable is set" << LL_ENDL; + system_root = "C:\\Windows"; // Last resort fallback + } params.executable = system_root + "\\explorer.exe"; params.args.add("/select,"); params.args.add(filepath); -- cgit v1.3