QtIFW QtPatch.cpp
-
Hi all,
I'm new to the Qt Installer Framework and I've found this file:
https://github.com/qtproject/installer-framework/blob/master/src/libs/installer/qtpatch.cppI'm asking myself if it does what I think it does, namely to replace the static paths compiled into QtCore*.dll and qmake.exe.
If this is the case how do I teach my installer to fullfil this task?
Kind regards,
Mike -
Hi,
What do you mean by "teach my installer to fulfil this task" ?
AFAIK, it's done for you automatically when running the installer.
-
Hi @SGaist,
I was expecting that QtIFW runs the patching automatically - but for me it doesn't. I have my own compiled Qt solution. I've taken an example of the QtIFW put my app and the dependend dlls into data.
After creating the installer and executing it the app and dlls got extracted but the dlls are remaining untouched - therefore I asked what conditions should be met to run the patch.
First of all I'm compiling Qt with a libinfix. To exclude this as an error source I renamed the core to Qt5Core.dll that the IFW is able to detect it as a file which needs to be patched - but it makes no difference. The dll still contains the old qt_prfxpath and not the path to the target install dir.
Any ideas?
Kind regards,
Mike -
Can you provide a minimal compilable example that shows that behaviour ?
-
Hi @SGaist ,
like I said, I made a full copy of this example:
QtIFW-3.0.2\examples\tutorial
to:
QtIFW-3.0.2\examples\tutorial2
Added my app and the Qt5Core.dll into:
QtIFW-3.0.2\examples\tutorial2\packages\com.vendor.product\data
I opened the console, switched to the bin dir of QtIFW and run this command:
binarycreator.exe --offline-only -t installerbase.exe -p "C:\Qt\QtIFW-3.0.2\examples\tutorial2\packages" -c "C:\Qt\QtIFW-3.0.2\examples\tutorial2\config\config.xml" "C:\Qt\QtIFW-3.0.2\examples\tutorial2\Installer.exe"
Nothing more.
The Qt5Core.dll and my app are copied to the install destination, but the DLL still has the qt_prfxpath of the build, not of the install destination or at least a dot to use the current dir. -
Just thought of something: the usual way to prepare your application before packaging it is to follow the deployment procedure (usually using windeployqt) and then use that to create the installer.
That way you ensure that your application is ready to run.