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
commit844ba99892e0a2c3ffff8b5a010c72104c8e41aa (patch)
treeb50492efc2b641b634d00b8f99d0b96ed5784ed6 /src/shared/skyriminfo.cpp
parent715623e7905e5f64f5b331f4523642aab1aedd34 (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());