diff options
Diffstat (limited to 'client/main.cpp')
-rw-r--r-- | client/main.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/client/main.cpp b/client/main.cpp index 4b6d734..f3c3d3d 100644 --- a/client/main.cpp +++ b/client/main.cpp @@ -1,5 +1,5 @@ -#ifdef WINDOWS +#ifdef WIN32 #define UpdaterName "updater.exe" #define PathSlash "\\" #else @@ -22,8 +22,17 @@ int main(int argc, char *argv[]) Logger::Info("Starting client application\n"); string path = argv[0]; + QString dir; size_t p = path.find_last_of(PathSlash); - QString dir = QString::fromStdString(path.substr(0, p)); + if (p == string::npos) + { + dir = QString::fromStdString("."); + } + else + { + dir = QString::fromStdString(path.substr(0, p)); + } + Logger::Trace("Application path: %s\n", dir.toStdString().c_str()); // check if client should be update |