[rkward] rkward: Add (on Windows: re-add) installed path to the system path, before attempting to launch the backend.

Thomas Friedrichsmeier null at kde.org
Tue May 15 14:16:23 UTC 2018


Git commit 815a322571aed4909f74bc106b32b5c4efaad818 by Thomas Friedrichsmeier.
Committed on 15/05/2018 at 14:14.
Pushed by tfry into branch 'master'.

Add (on Windows: re-add) installed path to the system path, before attempting to launch the backend.

Without this, the backend may fail to find libs and supporting binaries.

M  +6    -0    rkward/main.cpp

https://commits.kde.org/rkward/815a322571aed4909f74bc106b32b5c4efaad818

diff --git a/rkward/main.cpp b/rkward/main.cpp
index df55442e..6c3f848d 100644
--- a/rkward/main.cpp
+++ b/rkward/main.cpp
@@ -250,6 +250,12 @@ int main (int argc, char *argv[]) {
 		QProcess::execute ("launchctl", QStringList () << "load" << "/Library/LaunchAgents/org.freedesktop.dbus-session.plist");
 	}
 #endif
+	// This is _not_ the same path adjustment as above: Make sure to add the current dir to the path, before launching R and backend.
+	QStringList syspaths = QString (qgetenv ("PATH")).split (PATH_VAR_SEP);
+	if (!syspaths.contains (app.applicationDirPath ())) {
+		syspaths.prepend (RKCommonFunctions::windowsShellScriptSafeCommand (app.applicationDirPath ()));
+		qputenv ("PATH", syspaths.join (PATH_VAR_SEP).toLocal8Bit ());
+	}
 
 	// Handle --reuse option, by placing a dbus-call to existing RKWard process (if any) and exiting
 	if (parser.isSet ("reuse")) {



More information about the rkward-tracker mailing list