summaryrefslogtreecommitdiff
path: root/indra/llfilesystem/lldir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llfilesystem/lldir.cpp')
-rw-r--r--indra/llfilesystem/lldir.cpp11
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);