summaryrefslogtreecommitdiff
path: root/src/shared/skyriminfo.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2014-08-01 12:10:49 +0200
committerTannin <devnull@localhost>2014-08-01 12:10:49 +0200
commit5d4a55c3a67caec2811a2b997753adc116403d77 (patch)
treed41b89904717197efb5a2e00f906e534cb3c3d54 /src/shared/skyriminfo.cpp
parent470b6ed0bf20525988d719d23725f7c9d19a9f36 (diff)
- performance optimizations for detection of file changes in mod directories
- added a workaround for download-link handling in chrome - MO will now create a profile even if the game-launcher has never been run - bugfix: files weren't cleanly removed from vfs file register
Diffstat (limited to 'src/shared/skyriminfo.cpp')
-rw-r--r--src/shared/skyriminfo.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/shared/skyriminfo.cpp b/src/shared/skyriminfo.cpp
index 5017da38..72452255 100644
--- a/src/shared/skyriminfo.cpp
+++ b/src/shared/skyriminfo.cpp
@@ -273,7 +273,9 @@ void SkyrimInfo::createProfile(const std::wstring &directory, bool useDefaults)
std::wostringstream source;
source << getMyGamesDirectory() << L"\\Skyrim\\skyrimprefs.ini";
if (!::CopyFileW(source.str().c_str(), target.c_str(), true)) {
- if (::GetLastError() != ERROR_FILE_EXISTS) {
+ log("failed to copy ini file %ls", source.str().c_str());
+ // create empty
+ if (::CreateFileW(target.c_str(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL) == INVALID_HANDLE_VALUE) {
std::ostringstream stream;
stream << "failed to copy ini file: " << ToString(source.str(), false);
throw windows_error(stream.str());