The windeployqt tool that comes with Qt 5.2



  • [quote author="JKSH" date="1396918207"]The windeployqt tool that comes with Qt 5.2 ... [/quote]
    am i missed something, where is it?

    [edit : splitting this off since this gets into another topic., and using the new title easier to find, Eddy]


  • Moderators

    [quote author="qxoz" date="1396928953"][quote author="JKSH" date="1396918207"]The windeployqt tool that comes with Qt 5.2 ... [/quote]
    am i missed something, where is it?[/quote]C:<Qt>\bin\windeployqt.exe



  • Doesn't really work for me!? I always get this:

    bq. MyApp.exe: 32bit, release executable[QML]
    Unable to locate ICU library icuin51.dll

    even when I specify the bin dir myself (icuin51.dll is in there!)
    @
    C:\Qt\5.2.1\mingw48_32\bin\windeployqt.exe --dir C
    :\Qt\5.2.1\mingw48_32\bin MyApp.exe
    @

    am I using it wrong? I don't see much doc but it doen't work for me, I rather stick to manual deployment then haha


  • Moderators

    Yeah, because it suffers from exactly the problems I described ;)
    It's PATH dependent. If you do
    @
    set PATH=C:\Qt\5.2.1\mingw48_32\bin;%PATH%
    @
    before you use it it will work. Of course if you have different Qt in the path it will mess up your app ;) I guess it's meant to be run from an IDE that sets these paths for you (probably it's meant for WinRT deployment).
    Apart from that it doesn't handle plugins well (it just tosses them all in) and doesn't handle compiler runtime at all.
    But I guess it can be a starting point for a deployment script. I didn't know it existed. It's nice to see someone is working on that.



  • Hi, in Qt5.3 windeployqt gets a slight boost: it will also copy in the compiler runtime DLLs (both MinGW- and VS-flavor).

    Also for the PATH fiddling, when you install Qt on Windows, it will create a .bat file in C:\Qt\5.2.1\mingw48_32\bin called qtenv2.bat. (I.e. an easy way to set the path to your Qt.)



  • this is a good news :)



  • I got exactly the same error
    @Unable to locate ICU library icuin52.dll@

    In this thread am i blind or is there a solution in an answer?
    I mean what are the steps to fix the problem?

    I have run qtenv2.bat, same error

    I have Win8.1, qt 5.3.2 and its bin folder is located at C:\Qt\5.3\mingw482_32\bin, and my .exe released file is located at C:\Users\Leon\Desktop\applib\app.exe

    P.S newbie on deploying here



  • This post is deleted!

  • Moderators

    Two choices:

    open command prompt
    execute: C:\Qt\5.3\mingw482_32\bin\qtenv2.bat
    execute C:\Qt\5.3\mingw482_32\bin\windeployqt X:/path/to/your/app.exe

    You might need to play around with windeployqt parameters if you don't need everything eg. translations, plugins etc.

    go to C:\Qt\5.3\mingw482_32\bin
    manually copy any dlls you need to X:/path/to/your/app/directory/


  • Moderators

    This post is deleted!


  • Also, you could have some remnants of Qt 5.2 in your Win8.1 PC, because Qt 5.3.2 uses icuin52.dll, not icuin51.dll.

    So also perhaps check, what version of Qt windeployqt you have, type:
    windeployqt -v



  • This post is deleted!

  • Moderators

    @hskoglund - nice catch!


  • Moderators

    This post is deleted!


  • @chris: thanks, I did some compiling/testing of those icu*.dll chaps this summer because of this "bug":https://bugreports.qt-project.org/browse/QTBUG-39640

    It won't be fixed, but now that VS2015 is upon us, VS2012 is kind of obsolete anyway :-)



  • This post is deleted!

  • Moderators

    This sounds scary to debug if you don't know what to look for. I'm glad it's not me who had to deal with that :P
    And yeah, the split in VS2015 will undoubtedly cause some problems for people deploying their apps and looking for that MSVCR140 that is no longer there.


  • Moderators

    This post is deleted!


  • Chris Kawa

    1. I have actually managed to gather every dll needed, one by one, in order to run my .exe in another Pc not having qt installed. But it took me 20 minutes to delete one by one and my final folder should look like this:
      "http://i.imgur.com/wmyXybO.png":http://i.imgur.com/wmyXybO.png

    2. Didn't know i must run the dat from command, a lot of plugins got copied that was not neccesarry for running the .exe... (but they total 4mb) .. Is it for other version of Windows? I mean for example why do i need windowsprintersupport.dll? I don't use any kind of printing functions.. So which method is correct?

    hskoglund
    I edited my answer, it was icuin52.dll, i copied the error from google.



  • This post is deleted!

  • Moderators

    If you open qtenv2.bat in a text editor you will see that it just sets the PATH environment variable like I mentioned in one of previous posts. But this change is local to that batch environment so yeah, you need to run it from command prompt, some script or build system. And if you run two command prompts you would need to run it in both. It doesn't propagate (which is good!).

    You might not need all the stuff windeployqt copies over. It can't know what's gonna be loaded at runtime so it just plays it safe and copies everything. Just throw out what you don't use. Some can be skipped via command params, type "windeployqt" without params to see help.

    As for manual copying - it took me something like 20 minutes the first time too, then about 3 the second time and then I just wrote a .bat that does it for me and it takes me <1 second ever since. Such is coders life ;)

    Btw. Do you really use multimedia, webkit, widgets, qml, sensors, positioning and sql all in one app?


  • Moderators

    This post is deleted!


  • I don't think i do :D, but i could not run the .exe file without all of these .dll files

    my .pro file is this:
    "http://pastebin.com/zGH5RNR5":http://pastebin.com/zGH5RNR5

    and i guess the important line is
    QT += network widgets webkitwidgets

    am i doing something wrong?



  • This post is deleted!

  • Moderators

    Nah, I'm just asking. I would expect at least Qml and Quick to be not needed since your app seems to be widget based.

    Btw. few things strike me in your .pro file:

    Qt has its own "macos for os detection":http://qt-project.org/doc/qt-5/qtglobal.html#Macrosx. You don't need those ON_WIN32 and ON_LINUX

    Why do you have this: QT += gui-private ? Seems suspicious ;)


  • Moderators

    This post is deleted!


  • Soo... I am the creator of the .pro file posted above.

    1. Qml and Quick are needed by webkitwidgets. We have a feature that loads web pages internally and takes snapshots of them. So the whole dependencies tree of webkit widgets is loaded. Is there a way to be more specific of what part of webkit widgets you're interested in so as to throw out the unneeded dependencies?

    2. I know about those macros, but using my own has 2 benefits: (a) are shorter and cleaner, one can recognize them under non-Qt code and immediately understand what they're referring to. (b) I can be 101% sure that if gui-private is included then ON_WIN32 is used. With Q_OS_WIN32 I am only 99.9% :D

    3. gui-private is used for zip extraction under Windows (that's why it is included only there)



  • This post is deleted!

  • Moderators

    bq. Is there a way to be more specific of what part of webkit widgets you’re interested in so as to throw out the unneeded dependencies?

    I don't think so, at least I don't know one :(

    bq. are shorter and cleaner

    How is ON_WIN32 shorter and cleaner than Q_OS_WIN? They are the same length and to be honest at first glance I wondered what O N stands for :P

    bq. I can be 101% sure that if gui-private is included then ON_WIN32 is used. With Q_OS_WIN32 I am only 99.9%

    Equivalent of your define is Q_OS_WIN, not Q_OS_WIN32. win32 is both Q_OS_WIN32 and Q_OS_WIN64.
    I don't follow your logic. gui-private is included inside win32 brace, which is when Q_OS_WIN is defined. Where's the missing 0.1% of confidence?


  • Moderators

    This post is deleted!


  • Yeah I might be wrong on the macros, but I feel more confident knowing that ON_WIN32 is defined exactly when gui-private is included.

    Anyway, this can (and will) change very easily. The sad part is all the extra dlls coming from the webkitwidgets :/



  • This post is deleted!


  • Yeah, well, not totally wrong on the macros part... https://bugreports.qt-project.org/browse/QTBUG-34593

    It made me scratch my head multiple times why Q_OS_UNIX was working just fine but Q_OS_LINUX was failing....



  • This post is deleted!

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.