PDA

View Full Version : QT Applicaton installation



GrahamLabdon
25th October 2010, 09:19
Hi all
So I have my QT application (written on a windows platform using Eclipse and the MinGW toolchain).
Now I have to distirbute this to my clients who may have a MAC or Linux or Windows box.
What i am looking for is some advice on how this is normally managed. My clients are not usually 'computer savvy' so would expect some sort of installer program.
Is there an installer that can deploy to all platforms or will I need one for each?
What are other peoples experiences of this

TIA

Graham

burnttoy
25th October 2010, 09:46
Yup. They all tend to require a different approach.

The standard Mac way to ship your app is as a DMG (disk image) file - when that is "mounted" by the OS it will appear in Finder - the preferred mechanism is to show your application (.app file) and a link to "Applications" with a background image telling the user to drag the app to the applications folder to install it. Have a hunt through the "Disk Utility" documentation. Other options are programs like iDMG, EasyDMG etc.

Windows - good grief - there are MANY options - All I'll say is I've tried 4 or 5 and always end up coming back to Nulsoft NSIS http://nsis.sourceforge.net/ (http://nsis.sourceforge.net/). It's fairly simple and has a good community of users so web searches will usually tip up and answer in one or another forum. There are lots of sample files and the format for install scripts is raw text so it works nicely with source control systems.

Linux - blimey - here I will bow to someone with more knowledge than myself. The ultimate answer would be to package your application (rpm, deb etc) but that is a mystery to me. Another approach is to actually write an application that is shipped as an executable binary and then proceeds to copy files to where they need to go.

burnttoy.

skepticalgeek
26th October 2010, 20:43
As someone who has just written a cross platform Qt app, I can address a few of your questions. First off, you can't just distribute your program to folks running a different OS. Windows executables will not simply run on Mac or Linux boxes natively. Qt is write once, compile anywhere, not compile once run anywhere. Big difference. Forgive me if you already know this, but the wording of you opening sentence led me to believe you didn't.

I can't give advice about Mac, since what I know about that platform will fit into a thimble, but I'm pretty handy with the other two. First up, Windows. I don't know about NSIS, but I have successfully used a program called Inno for years. It has good documentation, the scripts are written in plain text, and has a lot of advanced features. You can create and modify registry entries, register DLL and OCX files, install custom fonts, etc. It produces a single setup exe that the users can easily walk themselves through.

Next up, Linux. I don't know if Eclipse and/or MinGw can cross compile and produce a Linux executable, but even if it can, I don't recommend it unless you want your users to end up in dependency hell. You will want to set up some sort of Linux development environment, and install Eclipse on it. Then, you will want to package your app. The two most common package formats are deb, used by Ubuntu and other Debian based distros, and rpm, used by Fedora, Mandriva, and other Red Hat offshoots. Do a Google search on creating rpm or deb files for a lot of good info, or you can use a program called Debreate. It will walk you through the process of creating a deb package, and even has a utility to convert it to an rpm. It does assume you have a basic knowledge of what is in a deb file, so you should read up a bit on that. Also, before packaging a Linux app, you will want to get the dependency info. Compile your app with Eclipse, and run a utility called ldd. This will give you dependency info for your app, which you can include in the package you create. This will allow the package management system on the target computer to resolve all dependencies automatically.

Sorry if I rambled on. Let me know if there is anything in this post that is unclear.

GrahamLabdon
27th October 2010, 08:34
Excellent advice - thanks