Failed to distribute applications in a MSYS2 environment
-
Hello,
I've written a Qt app that involves file handling. On Windows I'm doing development in Msys2 all the time. Packages including Qt are installed throughpacman
. It was time to distribute my application. I don't use an installer or sth similar. I just created an archive including the executable and all the necessary libraries and resources (copied from Msys2 installation).
Then the weird thing happened. The development took place under anAdministrator
account on my computer. I have another newStandard User
, too. So I switched to that user, starting my app, opening an image file. However, the call to QImage::load() that handles that event surprisingly returned false! (While it was always true on the Administrator account with the same file.) I'm unable to figure it out... Please help me... -
Hello,
I've written a Qt app that involves file handling. On Windows I'm doing development in Msys2 all the time. Packages including Qt are installed throughpacman
. It was time to distribute my application. I don't use an installer or sth similar. I just created an archive including the executable and all the necessary libraries and resources (copied from Msys2 installation).
Then the weird thing happened. The development took place under anAdministrator
account on my computer. I have another newStandard User
, too. So I switched to that user, starting my app, opening an image file. However, the call to QImage::load() that handles that event surprisingly returned false! (While it was always true on the Administrator account with the same file.) I'm unable to figure it out... Please help me...@Grit-Clef said in Failed to distribute applications in a MSYS2 environment:
the call to QImage::load() that handles that event surprisingly returned false!
Did you also deploy the plug-ins with your app?
See https://doc.qt.io/qt-6/windows-deployment.html -
Yes, I first used
windeployqt
to copy the file needed by Qt (platform dlls, imageformat dlls, and so on), then manually copied other dependencies from Msys2 installation.@Grit-Clef Run your app with QT_DEBUG_PLUGINS env variable set and check the output. See https://doc.qt.io/qt-6/debug.html
Most probably image pöug-in for the image format you're trying to open is missing (or one of its dependencies). -
It produced the following outputs:
loaded library imageformats/qgif.dll loaded library imageformats/qicns.dll loaded library imageformats/qico.dll Cannot load library imageformats\qjp2.dll: The specified module could not be found Cannot load library imageformats\qjpeg.dll: The specified module could not be found Cannot load library imageformats\qmng.dll: The specified module could not be found loaded library imageformats/qsvg.dll loaded library imageformats/qtga.dll Cannot load library imageformats\qtiff.dll: The specified module could not be found ......
but those dlls are there...
P.S. If I check
Run as Administrator
, then I see every dll under the directory is loaded correctly... -
It produced the following outputs:
loaded library imageformats/qgif.dll loaded library imageformats/qicns.dll loaded library imageformats/qico.dll Cannot load library imageformats\qjp2.dll: The specified module could not be found Cannot load library imageformats\qjpeg.dll: The specified module could not be found Cannot load library imageformats\qmng.dll: The specified module could not be found loaded library imageformats/qsvg.dll loaded library imageformats/qtga.dll Cannot load library imageformats\qtiff.dll: The specified module could not be found ......
but those dlls are there...
P.S. If I check
Run as Administrator
, then I see every dll under the directory is loaded correctly...@Grit-Clef said in Failed to distribute applications in a MSYS2 environment:
then I see every dll under the directory is loaded correctly
Then check the access rights.
-
Thanks for help. I'm able to run the app on a normal account, but the strangeness still remains... I'm blaming that on the Windows account itself.
@Grit-Clef I mean to check the access rights for the DLLs where you get "could not be found" ("but those dlls are there...").