Append .exe to crashreporter path so it is better located
authorHannah von Reth <hannah.vonreth@owncloud.com>
Wed, 21 Oct 2020 14:48:22 +0000 (16:48 +0200)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:59:25 +0000 (10:59 +0100)
src/gui/application.cpp

index d9272a69d990f5cb21e49f8de98ce1f2a148718d..022ae9a1dd3b1662aeec3de3591f5598f2c9bdab 100644 (file)
@@ -263,8 +263,15 @@ Application::Application(int &argc, char **argv)
         return;
 
 #if defined(WITH_CRASHREPORTER)
-    if (ConfigFile().crashReporter())
-        _crashHandler.reset(new CrashReporter::Handler(QDir::tempPath(), true, CRASHREPORTER_EXECUTABLE));
+    if (ConfigFile().crashReporter()) {
+        auto reporter = QStringLiteral(CRASHREPORTER_EXECUTABLE);
+#ifdef Q_OS_WIN
+        if (reporter.endsWith(QLatin1String(".exe"))) {
+            reporter.append(QLatin1String(".exe"));
+        }
+#endif
+        _crashHandler.reset(new CrashReporter::Handler(QDir::tempPath(), true, reporter));
+    }
 #endif
 
     setupLogging();