Deploying on other PC's doesn't work
-
Hi Community,
I've worked on a little project for a while now and i want to deploy it to another pc with Windows without QT installed.
I'm using Qt 5.9 installed today via Qt Online Installer and im using mingw as compiler (the standard from the online installer).The App itself is running smoothly when started via Qt Creator. When i copy the necessary DLL's and my release EXE in one folder it starts and works properly but when i copy it to another PC without QT installed it won't work at all.
There is no message/error that something is missing. The App just doesn't show up. There is also no process in the task manager. But the Event Viewer says that the App crashed but i cannot figure out why.
Things I've tried:
- Copy the DLL's by hand
- Copy the DLL's via windeployqt
- Copy all DLL's in the /bin/... folder and all folders from /plugins/...
I really don't know whats going wrong and I need some help :/
Greetings Lukas
-
To reproduce the issue on your development machine rename your Qt installation directory and start your app. It might tell you what's missing. If it doesn't download dependency walker, open you app in it and use the Profile->Start Profiling option. It will run your app and log all the libraries it tries to load, including the ones the app can't find. This should tell you what you're missing exactly.
-
@Chris-Kawa
Hi Chris-Kawa,thanks for the qucik reply. I've used the Dependency Walker but I cannot figure out what to do know with the result.
If I'm right the List in the bottom left tells me whats missing, but these arn't Qt Libraries, are they?
And I don't think I can look for all of them Oo. So what to do next?Greetings Lukas
-
In the profile window deselect all options (except maybe for the "clear log") before you run it. This should give you a clearer output - only libraries loaded. It's not necessary a Qt dll that is missing. It could be the compiler runtime library or a 3rd party dependency.
Maybe it's not a dll problem. Have you confirmed that it doesn't run on your dev machine if you rename Qt installation dir?
-
@FlyingHubert how did you 'deploy' your app? Did you simply double click on your exe and copied the missing dll's untill no error-box appeared?
That is potentially dangerous, as one is prone to miss stuff or copy the wrong one -> especially if you have multiple compilers and/or Qt versions installed.
I would recommand the windeployqt tool. In 90% off the cases that tool gets all needed dependencies for you.
-
So 2 things,
- I tried it they way you suggested Chris and after testing it several times on my PC and on the clean one (without Qt) Dependency Walker always hangs up at aloading IMM32.DLL (on both PC's)
- I tried many different approaches, but also the windeployqt doesn't seem to work for me.
So I've read the tutorials but isn't it just as simple als copiing the release exe to an empty folder and run windeployqt on this file?
-
Hi Community,
I'm really stuck here. Has nobody any idea what I can do? Because I can't figure out whats going on and now my second Project doesn't work on other PC's.
I mean is there anything I can test or try to get my programs running?
Greetings Lukas
-
Can you be more precise about the "doesn't work" ?
Is it crashing at startup ?
Is there a functionality missing ?
Do you have any external dependencies ?
From a quick look at the screenshots you posted, I would say no but it doesn't hurt to check. -
To add to @SGaist
Did you try to start the exe on the other machine via command prompt?
If I understand correctly, you can start the application in creator, but also externally on the developer's machine?
It is only the deployment machine giving you a hard time?
I suggest to try another PC too. Possibly your deployment machine has some fishy dlls. -
Thanks for your answers.
I'll try to post some more detailed information (maybe even my project) asap.The application doesn't start at all or more precisely it crashes silently when started. I assume that it fails at loading some dll's.
I don't think I've got any external dependencies. I only use the qt gui and the xml modul.I tried to start the app via doubleclick on 2 different Win 10 PC's.
(maybe at the weekend I'll find some time to investigate more deeply)
Good Evening,
Lukas
-
Then you should start it from a command line with the
QT_DEBUG_PLUGINS
environment variable set to 1. That should give you more clues about what is happening. -
@FlyingHubert said in Deploying on other PC's doesn't work:
The App itself is running smoothly when started via Qt Creator. When i copy the necessary DLL's and my release EXE in one folder it starts and works properly
This is good. Now, let's do a sanity check.
On your same Development computer which can run your release EXE properly, temporarily rename the C:\Qt\ folder to something else. Now, try running your release EXE again. Does it still work properly?
- If the answer is "Yes", that means your deployment is missing a non-Qt component
- If the answer is "No", that means your deployment is missing a Qt DLL.
-
In addition to what JKSH recommended, another tool that may help you is Process Explorer. Start your application from the deploy directory on your working machine, Then locate the application in Process Explorer and select it. In the bottom pane will be all the dlls that are being used, along with the path to them. Click the "Path" bar so they are sorted by path, and see if there are any that are not located in the C:\Windows... or your deploy directory.
-
Hi,
to clarify: you did put the plugins in their respective directories together with running dlls (qtcore.dll etc.) in the program folder?
I've encountered the behavior you describe - it was my fault, I forgot about plugins directory tree, just used the runtime dlls. -
Hi everyone,
I read all your comments and tried many different things... but because I can't get it running smoothly and because I haven't worked on the code and its purpose for a month now I decided to rewrite the whole program and try to figure out when and where it can't be executed on another PC anymore.
Thanks for your help and all the comments. I will do another thread if I get in trouble again.
Two last questions:
- Which guide would you recommend to deploy QT applications on windows platform.
Is it "http://doc.qt.io/qt-5/windows-deployment.html" because that one didn't work out that well for me :( - And which compiler would you use to compile - is mingw okay? (I need a free one if possible.)
Greetings Lukas
- Which guide would you recommend to deploy QT applications on windows platform.
-
Visual Studio also has a free edition.
Dependency Walker and windeployqt are usually enough to get your application running however without more details about your project it's difficult to help you find why it's not working properly once deployed.
-
@FlyingHubert I personally compile with mingw but deploy with Inno Setup - apart from regular tools it has IDE that works, involves Pascal Script to automate things and gives me total control over the installation or upgrade process. It is easy to learn the basics of that although documentation is somewhat scarce (for more advanced tasks some knowledge of Pascal would be recommended). And it is freeware.
Very unfortunately for myself I found deployment tools included with Qt a bit clumsy. -
Hello @FlyingHubert
I SOLVED, this is how mi app start to wok in other PCs:
The problem was when I was reading a file in my program at a specific path (example: C:\Program Files (x86)\TestQT1\test.txt) and when I execute the .exe file from another PC, the path was slightly different and it was crashing at the beggining.
I know this is a very old post at the time but I was looking for the same problem so hard and I spent a lot of time to find this issue, so I hope this information will be usefull for any other people
Regards.