DBus in PATH in Windows

Thomas Sondergaard ts at medical-insight.com
Thu Jan 12 02:37:32 PST 2012


On 12-01-2012 10:22, Ogden, Nick wrote:
> Hi,
>
> I have a very strange and awkward request from my boss, I’m sure you
> guys understand the kind I’m talking about. =P

I don't find it strange or awkward.

> I’m running DBus on Windows and using the QtDBus bindings on the
> application side. When kicking off an application that uses QtDBus, the
> DBus daemon is started if it is not already running. This, as I
> understand it, is a feature of the QtDBus bindings.

It's a feature of D-Bus

> This only seems to
> work when the DBus daemon (and related executables) are in the PATH.
> Thus I assume that the QtDBus bindings simply search the PATH for the
> DBus binaries and kicks off the process (perhaps via dbus-launch?).
>
> I also assume that, since the address of the Bus is required to initiate
> a connection, the QtDBus bindings will call one of the DBus binaries in
> order to get the connection details of the Bus if it is already started.
> This of course, would also require that the DBus binaries be in the
> PATH. This coincides with my experience, as removing the DBus binaries
> from the PATH prevents the application (using the QtDBus bindings) from
> even connecting to an already running Bus.
>
> Now my boss has it in his head that environmental variables are evil and
> has asked me to place all binaries, for all applications and for the
> DBus daemon, in the same directory. This is his idea of a ‘clean’
> solution, the thinking being that the application binary directory will
> be searched first before the system PATH, as is usual on Windows. Thus
> my question is this.

evil or not, not depending on the PATH is one less thing that can go wrong.

> Will the QtDBus bindings search the application binary directory for the
> DBus daemon or does they rely entirely on the system PATH?

It works. Code was recently added to D-Bus to make it also look in the 
directory where the dbus-1.dll resides, to make D-Bus launch work from 
e.g. browser plugins.

Cheers,

Thomas



More information about the dbus mailing list