PDA

View Full Version : deermine if Qt is installed



GrahamLabdon
9th November 2010, 09:23
Hi all
What is the best practice to programatically determine in Qt is installed on a given machine?
I use the following


QDir dir (QLibraryInfo::location(QLibraryInfo::BinariesPath ) + QDir::separator());

and then check if the directory exits.
Being new yo Qt I would appreciate feedback as to whether this is the best way

TIA

Graham

tbscope
9th November 2010, 09:34
Use A to check if A exists? I have a feeling that doesn't always work.

Create a script or whatever to check if qmake exists.

SixDegrees
9th November 2010, 09:35
If Qt isn't installed, QDir isn't going to work unless you happened to build everything using static libraries. This sort of task would be more appropriately handled using a wrapper script of some sort.

GrahamLabdon
9th November 2010, 10:13
Hi
Thanks for the reply
I am completely new to this!
I need to create a Qt app that deploys on Widows,Linux and Mac
For Windows I use Inno to create an installation file
For Linux I amusing Debreate to create a .deb file

Should I be using dynamically linked Qt libraies?
What is a wrapper script?

TIA
Graham

SixDegrees
9th November 2010, 13:57
Dynamic libraries are the preferred implementation in nearly all cases.

A wrapper script is a script that sets up the environment needed by an application, then invokes the application when all is as it should be. This would include checks for installed dynamic libraries needed by the application, setting environment variables and other tasks. Doing all this in a script ensures that the user will still receive a reasonable message if something is missing, and keeps the application from polluting the user's environment with it's own specialized settings.