Change default core library path

Hi,

I’m working on Windows, using C++ and Visual Studio. I’ve added an implementation of gstreamer into an already existing project and now I need to pack it and test it into our target machines.

The problem is that due to space and other project constraints, I cannot install gstreamer in each individual target machine, so my idea to package the program is to put all the necessary DLLs inside a folder within the build folder and read the necessary DLLs from there. Thus the ideal folder structure I would like to have is the following:

\root (where the .exe resides)
-----\gstreamer
------------\core (all the core libraries)
-------------\plugins (all the plugin libraries)
(I hope that the previous structure is understandable)

I’ve managed to make the program read the plugins from this structure using the following code before calling gst_init():

_putenv_s("GST_PLUGIN_PATH", plugin_path.c_str());

But I can’t seem to find a way to do the same for the core libraries, does anyone have any on how I coul achieve this ?

Thank you

Isn’t that covered by the system PATH variable?

What do you mean by that ?

I mean that the PATH environment variable governs the search location for dynamic libraries (DLLs) on Windows.

Ok, if you mean changing the PATH environment variable from the OS perspective, in other words manually going to the OS configuration (in this case windows), and changing or adding the PATH to the specific folder I need it.

I can’t see this approach usable for my particular case, as I would need to do it for every target machine where this software is installed (and it’s quite a long list of servers).

If you mean doing it programatically, changing this PATH each time the program is executed, while not ideal I would consider this as a short term solution.

All I’m saying is that this is not really a GStreamer specific thing :slight_smile:

Well, I thought it was, as gstreamer has the GST_PLUGIN_PATH for these same eaxct purpose but for plugin libraries, so I assumed there would be something similar for core libraries within gstreamer. Thus, I’ve decided to ask here.

Those core libraries are effectively “gstreamer”. They need to be loaded before any environmental variable(s) that they specify could have effect.

We use NSIS for creating windows apllication setup and with that we can add gstreamer to the system path. In the uninstaller we remove it from the path. We kept the same folder structure as gstreamer installation so in the nsis script this works:
EnVar::SetHKLM
EnVar::AddValue “Path” “path-to-our-app\gstreamer\bin”