From e635848438733f52d6893c68a0c14a8563fbb8c8 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sun, 26 Jul 2026 01:27:40 +0200 Subject: [PATCH] =?UTF-8?q?Use=20=E2=80=9CQCoreApplication::applicationFil?= =?UTF-8?q?ePath=E2=80=9D=20instead=20of=20argv[0]=20for=20the=20name=20of?= =?UTF-8?q?=20the=20executable=20file,=20as=20argv[0]=20does=20not=20alway?= =?UTF-8?q?s=20contain=20the=20full=20path=20on=20Windows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- retroshare-gui/src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/src/main.cpp b/retroshare-gui/src/main.cpp index dd343bf03..9d0020d0e 100644 --- a/retroshare-gui/src/main.cpp +++ b/retroshare-gui/src/main.cpp @@ -326,11 +326,13 @@ int main(int argc, char *argv[]) qt_use_native_dialogs = false; #endif + QString applicationFilePath; { /* Set the current directory to the application dir, because the start dir with autostart from the registry run key is not the exe dir */ QApplication app(argc, argv); QDir::setCurrent(QCoreApplication::applicationDirPath()); + applicationFilePath = QCoreApplication::applicationFilePath(); } #endif #ifdef SIGFPE_DEBUG @@ -427,7 +429,7 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO); // Now start RS login system - conf.main_executable_path = argv[0]; + conf.main_executable_path = applicationFilePath.toStdString(); int initResult = RsInit::InitRetroShare(conf);