Important: Please read the Qt Code of Conduct -

windeployqt: remove virtualkeyboard from deploy

  • We have a desktop app that does not use the virtualkeyboard. This is a 5.12.x app. I noticed windeployqt for 5.14.x has an option for this already. However, we are on the LTS version 5.12 at present. So I was trying to figure out how to remove the file from the INSTALLS list during the qmake process.

    I tried this:

    deploy_script.path = $$INSTALL_BASE
    deploy_script.extra = $$QTDIR/bin/windeployqt --release --qmldir qml/ $$INSTALL_BASE
    INSTALLS += deploy_script
    INSTALLS -= $$QTDIR/bin/Qt5VirtualKeyboard.dll
    INSTALLS -= $$QTDIR/plugins/virtualkeyboard/*

    However, I think the install does not yet include those files at that step. I don't think the script has run yet. How do I attach this logic to the deploy_script? This is on a windows machine so I don't have grep available. There is not an option in 5.12 for excluding specific files with windeployqt that I can tell.

  • LOL, well, after posting I thought of a way. Windows only, but so is windeployqt...

    deploy_script.path = $$INSTALL_BASE
    deploy_script.extra = $$QTDIR/bin/windeployqt --release --qmldir qml/ $$INSTALL_BASE
    # --no-virtualkeyboard
    INSTALLS += deploy_script
    deploy_script_filter.path = $$INSTALL_BASE
    deploy_script_filter.extra = del "$$shell_path($$INSTALL_BASE/Qt5VirtualKeyboard.dll)" $$escape_expand(\n\t) del /Q "$$shell_path($$INSTALL_BASE/virtualkeyboard/*)" $$escape_expand(\n\t) rmdir "$$shell_path($$INSTALL_BASE/virtualkeyboard)"
    INSTALLS += deploy_script_filter

    The text after deploy_script_filter.extra = is 3 commands on the same line.

    Edit: Its for posterity. Moving to 5.14 will already have a solution.

Log in to reply