PDA

View Full Version : qt deployment problem on windows xp



sepp
26th May 2007, 13:55
hi,

i have a real strange problem with deployment of my qt 4.2.3 application on windows xp.
i made a setup.exe which copies the application, the qt dlls, the runtime as well as the imageformats folder containing qjpeg1.dll alsong with the manifest to a local folder on the destination system.

in most cases, the program runs fine.

however, on some windows xp systems the program fails to load jpeg images, thus the plugin qjpeg1.dll is either not loaded or not working.

qt on my development system is configured with the -qt-libjpeg switch.

main.cpp set's the library path as follows:


QStringList paths;
paths.append(app.applicationDirPath());
app.setLibraryPaths(paths);


thus, any other qt plugins which might be on the destination system should not interfere.

does anybody has a clue what's going wrong here?

thanks

sebastian

spud
28th May 2007, 14:05
Try finding out qjpeg1.dll's dependencies using depends.exe(available in the PSDK). Do you include both msvcpXX.dll and msvcrXX.dll in your installer? Maybe you forgot the c runtime dll(as opposed to the c++ one) and qjpeg1.dll needs it.

P.S.
If everything else fails, try FileMon (http://www.microsoft.com/technet/sysinternals/FileAndDisk/Filemon.mspx) from sysinternals and see what file access is going on when your application fails.

sepp
4th June 2007, 09:06
hi spud,

that was a good tip...
anyway, it lead to something completely different: to use depends, i had to install vc++ on the destiantion system. after installing vc++, the problem was gone. i think the following is going wrong here:

i deploy the application like described in the Qt docs ('Deploying an Application on Qt/Windows'), having the qt dlls and the c/c++ runtimes in the applications directory and the plugins in an ./imageformats subfolder. with a prior version of my app (based on qt 4.1, i think), that worked on xp destination systems without c/c++ runtimes installed into the winsxs side-by-side cache through other applications.

however, with this version based on 4.2.3, the app starts on a system without other c/c++ runtimes, i.e. uses the runtimes i install locally, but the plugins don't. strange. i'll be after that.

thanks,

sepp

sepp
5th July 2007, 11:16
hi,

meanwhile, trolltech has confirmed that this is a bug.

the problem is that when deploying a qt/win 4.2.x application which needs (imageformats) plugins and which is build with Visual Studio 2005, the plugins will fail to load on a 'fresh' windows xp/server2003 system, even if the application is deployed as trolltech itself recommends (that is, deploying the microsoft vc 8.0 runtimes as 'application local' inside the applications directory).

the reason seems to be that the plugins (which in turn need the runtimes) don't get the runtimes from the applications folder AND that the runtimes are not in the WinSxS folder on a fresh system.

the workaround is not really easy, because you cannot simply copy the runtimes to WinSxS.

anyway, there is a good article as well as a bootstrapper for the runtimes here:

http://www.codeproject.com/cpp/vcredists_x86.asp

i have solved the problem with the approach given there by adding a slightly modified bootstrapper to my setup executable...