Message box fix: 7ead3a39c71949e28d682f893f8b4037e25d7259
I installed 5.1.0 RC1 Snapshot after previously using 4.7.4 and encountered quite a serious problem which seems to be caused by a few seemingly minor issues working together. The results were quite serious and I believe it may affect many other users of Qt on Windows.
Our usual build process is to compile in Visual Studio, test a Release EXE locally, and then deploy to users with QtCore/QtGui DLLs in the same directory. I tested locally, committed the new tool and DLLs and left for the night thinking I had tested it thoroughly, only to find that no-one could run the tool the next morning!
There was no error message, the application simply failed to launch.
Using Process Monitor we found it was searching for platforms/qwindows.dll but I couldn't understand why I hadn't spotted that locally in my testing. I used Process Hacker and found that the tool was actually loading qwindows.dll directly from my original Qt installation directory!
I searched for environment variables, and even through the registry to find out how the application 'knew' where my Qt installation directory was. Eventually I found using cygwin and 'strings' that my Qt installation directory was baked into Qt5Core.dll directly! I was very surprised by this.
Here is what I found:
Since other people are likely to hit the same problem, I would strongly suggest fixing a few of these issues:
- Don't bake local paths into DLLs by default, use only relative paths (or perhaps an environment variable?)
- If qwindows.dll cannot be found, maybe provide feedback to the user instead of just exiting
- relates to
QTBUG-31765 MSVC2010 applications crash on windows 8