Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Windows Deployment: dealing with variable PATH
xtingray last edited by xtingray
Currently, I am developing a Windows application using shared libraries. The way I launch it is calling a .bat script, just like this one:
@echo OFF set PATH=..\lib;..\lib\qt5;..\lib\libav app.exe %1
It works like a charm, but I wonder if there is a way to avoid the .bat script by defining the variable PATH from the main.cpp code of my app. Just guessing, in that way I would be able to open my application just clicking on the app.exe binary.
Is there a way to make this possible without compiling the app as static? I appreciate any hint.
6thC last edited by
It looks like you are trying to add library paths to your app. If that is the case you could check out
QCoreApplication::addLibraryPath. That should do what you need without the need for the .bat script and the modification to the system path.