views:

396

answers:

2

I've got a Qt app that I need installed on a customers computer, which I can't assume has Qt installed on it. I'm on a Mac OSX and the computer I will be installing it on some Unix based system. I will be installing it myself so I don't need a GUI installation wizard or anything like that. Ideally I'd like to end up with a script or makefile, along with a folder of all the sources and necessary libraries, I just don't know where to start. References would be much appreciated, I haven't found anything useful after many google searches.

My question lies somewhere between these two:
Can you create a setup.exe in qt to install your app on a client computer?
Create Linux install for Qt application?

I don't need a full-blown install wizard (question 1), but I also won't have my machine at the installation site to just keep copying libraries until all dependencies are met (question 2). Basically I need to have everything on a CD ready to install when I get there. Thanks in advance.

+5  A: 

There are two ways to install a Qt application on a system:

1 - You can compile Qt statically. This will allow you to deploy you app without any qt dependencies.

2 - You need to deploy your app with Qt librairy files you need (like qtcore.dll on Windows)

You will find all explications for each platform in the Qt documentation : http://doc.trolltech.com/4.6/deployment.html.

To create installer you can use InstallJammer for Windows and Unix.

For MacOSX you need to create a dmg image. This is very simple. Read the following web page for help : http://www.wikihow.com/Make-a-DMG-File-on-a-Mac. By using apple script you can customize dmg (like an Application folder link into the dmg).

My preference for Win32 installer is NSIS.

Hope that helps!

Patrice Bernassola
If I compile Qt statically, wouldn't I need to compile on the exact same system/architecture as the customers computer? Is there a way to get around having to compile the source on their system?
Graphics Noob
You will have to compile Qt on each system in order to have static OR dynamic libraries to use with your application. In the 2 ways it's the same (except that dynamic libraries are already compile if you install the whole framework)
Patrice Bernassola
Also it should be noted that you can't distribute a closed-source, statically-complied Qt app under the LGPL license.
Graphics Noob
A: 

Not sure why you want to avoid the install wizard. It can also help you create Uninstaller, desktop and start menu shortcuts, etc. As mentioned in the posts you refer to, you could use BitRock InstallBuilder (Nokia uses it for Qt Creator)

If you do not want to use a wizard and don't want to compile statically, then you can bundle Qt libraries in the same folder as the app and setup a shell script that sets the LD_LIBRARY_PATH to that directory

Daniel Lopez