diff options
| author | Carbon Cowboy <254348425+carboncowboy@users.noreply.github.com> | 2026-02-02 17:18:45 -0800 |
|---|---|---|
| committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2026-02-03 12:16:53 +0200 |
| commit | 556728c04a5cfb82ed4f7bd19b9b25b101e127c3 (patch) | |
| tree | 0b0477a1935f259d18dc500d4686c57596d5657e | |
| parent | 82ff4344f65f91c3536212ecd06934d389b2063e (diff) | |
Improve windir detection in LLDir::openDir
| -rw-r--r-- | indra/llfilesystem/lldir.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
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); |
