I have written a portable C++ application using Qt libraries. This means that I cannot use the MT flag for compiling without risking memory issues.

This leaves me with two options:

1) Deploy the portable application with an installer.

2) Package the C++ dependencies within the same folder or use private assemblies.

Both 1 and 2 defeat the idea of portable software, so I was thinking of a third option:

3) Use IExpress to drop the C++ dependencies before launching the application. On exit, delete the C++ dependencies.

Unfortunately, option 3 has received some flak from some stackoverflow members. They even dislike option 2 which leaves me with only option 1. I can see option 1 as doable if I use a portable installer.

Is there such thing as a portable installer? Essentially, I want the installer to check to see if the needed dependencies are installed before running my application (just like a regular installer would) and if they are, then just continue running my application. Otherwise, give a message box to the user that they could download it providing a link to the URL. I am aware I can write my own installer that can do this in C++ but I was wondering if there are any installers that already offer this specific functionality.

Your question isn't very clear. I suggest adding links to the stackoverflow question's you allude to. I'm assuming you're talking about windows deployment- but what Windows versions are you targeting?. Also, I suspect your definition of "portable" is not the same as someone else's (I'm guessing you mean "runs off of a USB stick?") Also, your tags seem off- why tag with QT if this isn't qt specific?
–
Rian SandersonApr 8 '13 at 23:32

Maybe this link will be more helpful? qt-project.org/faq/answer/… I can't find the stackoverflow question anymore. :( I'm targeting Windows Vista/7/8. My definition of portable is something that is confined into one EXE and can run off a USB stick.
–
user2258753Apr 8 '13 at 23:37

The -MT flag should have nothing to do with portability, unless a target platform doesn't support threading. In which case, you're already likely assuming threading, from the use of the flag, and you're hosed.
–
Nathan ErnstApr 9 '13 at 1:25

1 Answer
1

The dlls for Qt in windows are so small, that deploying them with the application isn't an issue in my opinion.

There aren't any programs out there that I know of that place the Qt dlls on windows in some place that another program later would find (like c:/Windows/system32).

I think the only place where you could expect reuse of the libraries is in Linux or a mobile device that has a lot of Qt apps. But even then you have make sure that the versions of the libraries are high enough to support all the functionality that you are using.

The issue isn't with Qt's DLLs. The issue is with C++'s DLLs. The Qt libraries are statically linked into the executable. Sorry for not being clear on that. The MT flag I was referring to was for the MSVC compiler.
–
user2258753Apr 8 '13 at 22:57

@user2258753: If your Qt DLLs are linked static why not go ahead and do the C++ libraries as a static link also?
–
Zan LynxApr 8 '13 at 23:40

@user2258753: Sounds like a cop-out to me by the Qt people: "We have memory problems. We won't bother to figure out what the problem is, we'll just document it and go on."
–
Zan LynxApr 8 '13 at 23:46

@ZanLynx: It seems more of a fundamental issue due to multiple heaps. "if I remember correctly, /MT links the c-runtime statically. This means, each library and the executable have own versions of the c-runtime. Statical linkage might result in different heaps you are using which will exactly throw out this error." To be honest, I don't really understand fully.
–
user2258753Apr 8 '13 at 23:48