1

I am making a Qt 5.0.2 C++ GUI program that I want to release to a single .exe file. In the past, I have made simple console applications with Visual Studio 2008 and releasing it was easy and I like to "debug" my program in it's released state.

With that being said, I know that releasing a program in Qt requires a bunch of Qt libraries to go along with it. Another option was to use an installer?

I really want to avoid complicated things for my users. (They are generally young) So a simple, standalone exe would be ideal.

Any ways of doing this? :)

EDIT: This is not the same as the "duplicate" post. lpapp has decided to go to almost all of my questions and falsely mark them as duplicates even though they are not all over an argument. This question is not about bug fixing a release or finding out why it doesn't work, it is about finding the easiest way to release a program so that the users don't have to jump through lots of hoops to run my program.

mrg95
  • 2,371
  • 11
  • 46
  • 89

2 Answers2

1

Static linking of a Qt library could be one of the solutions. There are thousands of manuals on the net how to make it. Just use a search. E.g. Qt static linking and deployment

Also a kind of self-extracting archive could be the simplest and fastest solution. Your users will still receive a single* file. Libraries would be contained inside of it.

Community
  • 1
  • 1
Kolyunya
  • 5,973
  • 7
  • 46
  • 81
  • Static linking? That is a new term for me. :) Thank you, I will look into it. – mrg95 Jul 17 '13 at 07:40
  • 3
    Note that you need the commercial license if you want to deploy programs using static linking. –  Jul 17 '13 at 07:47
  • Dang, I didn't think about that. Looks like I'm gonna have to use an installer :( – mrg95 Jul 17 '13 at 08:27
  • 1
    @mc360pro a kind of self-extracting archive could be the simplest and fastest solution. Your users will still receive a single* file. Libraries would be contained inside of it. – Kolyunya Jul 17 '13 at 08:32
  • Yeah thats what I was thinking. Im just gonna have to tell everyone to get winrar or 7zip :/ No big deal I guess. – mrg95 Jul 17 '13 at 08:57
  • 1
    @mc360pro I believe even no additional software is needed to extract a self-extracting archives http://en.wikipedia.org/wiki/Self-extracting_archive – Kolyunya Jul 17 '13 at 09:01
  • Yes, you can create self-extracting archives with WinRAR and 7zip. The user doesn't need to install any extracting software. –  Jul 17 '13 at 09:57
1

Write an installer for it.

On windows, InnoSetup is very easy & quick to use.

You will need to include the Qt dll's you need. Additionally you will need to make sure that any plugins you use (e.g. if you open png or jpeg files) are distributed correctly, consult the Qt documentation about this. Test the install on a computer (or virtual machine) that you have not installed the Qt SDK on to make sure that it works.

You will also need to deploy the VS2008 runtime distributable too if you dynamically link to it (the default).

Pete
  • 4,784
  • 26
  • 33
  • Hi Pete, Is it necessary to have an installer? What if you release your .exe with required .dll's in a zip file which the user has simply to unzip & then run your .exe directly? I am asking because in some commercial organisations people don't get admin privilages. So it is best to avoid an installer? – Cool_Coder Oct 04 '13 at 17:32
  • Yes you could just use a zip file. – Pete Oct 05 '13 at 07:14
  • any image plugins (e.g. qjpeg4.dll) need to go in a subfolder called 'imageformats'. The rest of the dlls alongside the exe. – Pete Oct 05 '13 at 07:16
  • I would recommend testing on another machine (or a VM) that has not had VS2008 or Qt installed ever. – Pete Oct 05 '13 at 07:17