From 5002bf5660f41685fc0549880994f4b35440d535 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 20 Dec 2017 22:51:26 -0500 Subject: MAINT-8087: Use env vars from VMP for AppData\Roaming and Local. On Windows, when logged in with a non-ASCII username, every one of the three documented APIs -- SHGetSpecialFolderPath(), SHGetFolderPath() and SHGetKnownFolderPath() -- fails to retrieve any pathname at all. We cannot account for the fact that the oldest of these continues to work with the release viewer and within a Python script (though not, curiously, from a Python interactive session). With a non-ASCII username, they consistently fail when called from an Alex Ivy viewer build: "The filename, directory name, or volume label syntax is incorrect." Empirically, with a non-ASCII username, the preset APPDATA and LOCALAPPDATA environment variables are also useless, e.g. c:\Users\??????\AppData\Roaming where those are, yup, actual question marks. Empirically, the VMP is able to successfully call SHGetFolderPath() to retrieve both AppData\Roaming and AppData\Local. Therefore, we make the VMP set the APPDATA and LOCALAPPDATA environment variables to the UTF-8 encoded correct pathnames. Instead of calling SHGetSomethingFolderPath() at all, make LLDir_Win32 retrieve those environment variables. Make LLFile::mkdir() treat "directory already exists" as a success case. Every single call fell into one of two categories: either it didn't check success at all, or it tested specially to exempt errno == EEXIST. Migrate that test into mkdir(); eliminate it from call sites. Make LLDir::append() and add() convenience functions accept variadic arguments. Replace add(add()...) constructs, as well as clumsy concatenations of directory names and getDirDelimiter(), with simple variadic add() calls. --- indra/newview/llappviewer.cpp | 10 ++-------- indra/newview/llpresetsmanager.cpp | 10 ++-------- indra/newview/lltexturecache.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 20 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 087a672d69..b33b3a6410 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4136,10 +4136,7 @@ void dumpVFSCaches() S32 res = LLFile::mkdir("StaticVFSDump"); if (res == -1) { - if (errno != EEXIST) - { - LL_WARNS() << "Couldn't create dir StaticVFSDump" << LL_ENDL; - } + LL_WARNS() << "Couldn't create dir StaticVFSDump" << LL_ENDL; } SetCurrentDirectory(utf8str_to_utf16str("StaticVFSDump").c_str()); gStaticVFS->dumpFiles(); @@ -4153,10 +4150,7 @@ void dumpVFSCaches() res = LLFile::mkdir("VFSDump"); if (res == -1) { - if (errno != EEXIST) - { - LL_WARNS() << "Couldn't create dir VFSDump" << LL_ENDL; - } + LL_WARNS() << "Couldn't create dir VFSDump" << LL_ENDL; } SetCurrentDirectory(utf8str_to_utf16str("VFSDump").c_str()); gVFS->dumpFiles(); diff --git a/indra/newview/llpresetsmanager.cpp b/indra/newview/llpresetsmanager.cpp index 76d721ecdc..96818d5a21 100644 --- a/indra/newview/llpresetsmanager.cpp +++ b/indra/newview/llpresetsmanager.cpp @@ -78,16 +78,10 @@ std::string LLPresetsManager::getPresetsDir(const std::string& subdirectory) std::string presets_path = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, PRESETS_DIR); std::string full_path; - if (!gDirUtilp->fileExists(presets_path)) - { - LLFile::mkdir(presets_path); - } + LLFile::mkdir(presets_path); full_path = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, PRESETS_DIR, subdirectory); - if (!gDirUtilp->fileExists(full_path)) - { - LLFile::mkdir(full_path); - } + LLFile::mkdir(full_path); return full_path; } diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 435d833345..371da5d0a2 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -1054,11 +1054,11 @@ S64 LLTextureCache::initCache(ELLPath location, S64 max_size, BOOL texture_cache return max_size ; } } - + if (!mReadOnly) { LLFile::mkdir(mTexturesDirName); - + const char* subdirs = "0123456789abcdef"; for (S32 i=0; i<16; i++) { @@ -1602,11 +1602,11 @@ void LLTextureCache::clearCorruptedCache() closeHeaderEntriesFile();//close possible file handler purgeAllTextures(false) ; //clear the cache. - + if (!mReadOnly) //regenerate the directory tree if not exists. { LLFile::mkdir(mTexturesDirName); - + const char* subdirs = "0123456789abcdef"; for (S32 i=0; i<16; i++) { -- cgit v1.2.3 From 7ac3a755e713d0a34747660b3d48d0a7f6978c3e Mon Sep 17 00:00:00 2001 From: callum_linden Date: Thu, 21 Dec 2017 14:36:50 -0800 Subject: MAINT-8119 Fix. A change elsewhere in the viewer_manifest.py script that copies files into the right place after a build impacted the fragment of code that copies over the VLC runtime files (Libvlc.dll, libvlccore.dll and the VLC plugins dir) and they never made it to the right place. This change restores that copy --- indra/newview/viewer_manifest.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index f930e8b2ce..e0c332681e 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -689,10 +689,10 @@ class WindowsManifest(ViewerManifest): self.path("zh-CN.pak") self.path("zh-TW.pak") - with self.prefix(src=os.path.join(pkgdir, 'bin', 'release'), dst="llplugin"): - self.path("libvlc.dll") - self.path("libvlccore.dll") - self.path("plugins/") + with self.prefix(src=os.path.join(pkgdir, 'bin', 'release'), dst="llplugin"): + self.path("libvlc.dll") + self.path("libvlccore.dll") + self.path("plugins/") # pull in the crash logger and updater from other projects # tag:"crash-logger" here as a cue to the exporter -- cgit v1.2.3