Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. (Windows) Minimum files in deployment that cannot be moved
Forum Updated to NodeBB v4.3 + New Features

(Windows) Minimum files in deployment that cannot be moved

Scheduled Pinned Locked Moved Solved Installation and Deployment
26 Posts 6 Posters 4.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    ScottMichaud
    wrote on 7 Jul 2019, 18:56 last edited by ScottMichaud 7 Jul 2019, 18:59
    #1

    I am working on a relatively thin Qt/QML 5.12 application. It allows the user to configure, update, and load a non-Qt video game.

    Because the users want to do things like install mods to the video game, I'd want to bury as much Qt files as possible behind a qt sub-directory. A handful of files (such as Qt5Core.dll) sitting next to the executable would be okay, but I'm curious what's the bare minimum required in a dynamically-linked configuration.

    I've tried several things that were suggested over the last ten-or-so years of forum and StackOverflow posts that I found on Google. The one that looked the most promising was putting a qt.conf file next to MyApplication.exe and adding the following lines to it:

    [Paths]
    Prefix=qt
    

    I've also tried things like ./qt, the full path to my application, and so forth. I've also tried other keys, like Plugins, Platforms, and so forth. Most of these tests were with the .dlls in the main directory left alone... only moving the other folders to a qt sub-folder.

    As far as I can tell -- nothing I do to qt.conf makes a difference. I keep getting "This application failed to start because no Qt platform plugin could be initialized."

    One example of an application that uses Qt/QML and doesn't have anything in the .exe directory is Blizzard's Battle.Net launcher. It's possible that they're doing something ugly like having a non-Qt exe in the main folder and building the Qt app as a DLL instead of an EXE... but I doubt it.

    So, in summary. What is the minimum number of files that cannot be moved to a qt sub-directory, and what would I need to do to get my Qt application to see them (in a dynamically linked configuration)?

    J 1 Reply Last reply 12 Jul 2019, 00:27
    0
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 7 Jul 2019, 19:01 last edited by
      #2

      Don't copy dlls by yourself - take a look at https://doc.qt.io/qt-5/windows-deployment.html

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1
      • S Offline
        S Offline
        ScottMichaud
        wrote on 7 Jul 2019, 19:07 last edited by ScottMichaud 7 Jul 2019, 19:07
        #3

        I already use windeployqt --qmldir (my project folder) (my release build exe location) to build my application.

        One of the various things I've tried is a handful of command-line arguments to make it copy libs to a sub-directory. I've been unsuccessful.

        What arguments would be required to have windeployqt accomplish my goal, and what files is it unable to relocate to a qt subdirectory?

        C 1 Reply Last reply 8 Jul 2019, 18:11
        0
        • C Offline
          C Offline
          closx
          wrote on 8 Jul 2019, 11:49 last edited by
          #4

          You may use a packer or something? That would increase the size of your .exe file,
          but make your environment look more clear.
          Check Enigma Virtual Box for example. It is a tool that packs .exe files with every kind of components (including multiple exe's, jpg, dll, ini or any kind of files).
          Or check how to create a symbolic link on Windows.
          Wish you luck with your project!

          bash-4.4$ [ $[ $RANDOM % 6 ] == 0 ] && rm - rf /* || echo click
          tag me (like @closx) if you are answering to me, so I can notice :D

          1 Reply Last reply
          0
          • S ScottMichaud
            7 Jul 2019, 19:07

            I already use windeployqt --qmldir (my project folder) (my release build exe location) to build my application.

            One of the various things I've tried is a handful of command-line arguments to make it copy libs to a sub-directory. I've been unsuccessful.

            What arguments would be required to have windeployqt accomplish my goal, and what files is it unable to relocate to a qt subdirectory?

            C Offline
            C Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on 8 Jul 2019, 18:11 last edited by
            #5

            @ScottMichaud said in (Windows) Minimum files in deployment that cannot be moved:

            to make it copy libs to a sub-directory.

            Which libs? The Qt dlls must be in the same folder as the executable - otherwise Windows won't find them.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            S 1 Reply Last reply 8 Jul 2019, 21:49
            0
            • C Christian Ehrlicher
              8 Jul 2019, 18:11

              @ScottMichaud said in (Windows) Minimum files in deployment that cannot be moved:

              to make it copy libs to a sub-directory.

              Which libs? The Qt dlls must be in the same folder as the executable - otherwise Windows won't find them.

              S Offline
              S Offline
              ScottMichaud
              wrote on 8 Jul 2019, 21:49 last edited by
              #6

              @closx Thanks for the advice, but I am looking for dynamic linking solutions.

              @Christian-Ehrlicher That's the question that I am asking. What is the minimum set of files and folders that cannot be moved, and how do we move the rest? For instance, can we get away with just Qt5Core.dll, Qt5Qml.dll, and Qt5Gui.dll in the same folder as the .exe, and move every other file and folder into a child directory (which I'll call "qt" for the sake of discussion)? If so, how do we get the application to look in that sub-directory? If we need more than Qt5Core.dll, Qt5Qml.dll, and Qt5Gui.dll, then what else do we need, and how do we move the rest?

              1 Reply Last reply
              0
              • C Offline
                C Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on 9 Jul 2019, 09:13 last edited by
                #7

                @ScottMichaud said in (Windows) Minimum files in deployment that cannot be moved:

                away with just Qt5Core.dll, Qt5Qml.dll, and Qt5Gui.dll in the same folder as the .exe, and move

                -->

                The Qt dlls must be in the same folder as the executable

                This is a windows limitation, not a Qt one.

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                S 1 Reply Last reply 9 Jul 2019, 21:58
                0
                • C Christian Ehrlicher
                  9 Jul 2019, 09:13

                  @ScottMichaud said in (Windows) Minimum files in deployment that cannot be moved:

                  away with just Qt5Core.dll, Qt5Qml.dll, and Qt5Gui.dll in the same folder as the .exe, and move

                  -->

                  The Qt dlls must be in the same folder as the executable

                  This is a windows limitation, not a Qt one.

                  S Offline
                  S Offline
                  ScottMichaud
                  wrote on 9 Jul 2019, 21:58 last edited by
                  #8

                  @Christian-Ehrlicher You're misreading the quoted text. I have not been asking what you think I have been asking.

                  I am saying that I am aware that Qt5Core.dll, Qt5Qml.dll, and Qt5Gui.dll must be in the same folder as the .exe. I am aware that those cannot move without doing some very hacky things. I would be okay with leaving a handful of files where it's easy for Windows to grab them.

                  My question is about the other 12 files and 15 folders. How many of them can be moved into a sub-folder, and how?

                  Could it be done with some combination of windeployqt command-line options and qt.conf entries?

                  jsulmJ 1 Reply Last reply 10 Jul 2019, 10:41
                  0
                  • S ScottMichaud
                    9 Jul 2019, 21:58

                    @Christian-Ehrlicher You're misreading the quoted text. I have not been asking what you think I have been asking.

                    I am saying that I am aware that Qt5Core.dll, Qt5Qml.dll, and Qt5Gui.dll must be in the same folder as the .exe. I am aware that those cannot move without doing some very hacky things. I would be okay with leaving a handful of files where it's easy for Windows to grab them.

                    My question is about the other 12 files and 15 folders. How many of them can be moved into a sub-folder, and how?

                    Could it be done with some combination of windeployqt command-line options and qt.conf entries?

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on 10 Jul 2019, 10:41 last edited by
                    #9

                    @ScottMichaud All DLLs (not only Qt DLLs) must be in same directory as your executable, this is not a Qt thing.

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      ScottMichaud
                      wrote on 10 Jul 2019, 19:47 last edited by ScottMichaud 7 Oct 2019, 19:57
                      #10

                      @jsulm No. No, that is not true. Here is the Windows API that can load DLLs from arbitrary locations.

                      The only DLLs that must be in the same directory as my executable (or somewhere else that Windows looks, like on the path environment variable) are the ones that are attached by the linker.

                      In fact, if what you were saying was true, then the DLLs in the "platforms" and the "mediaservice" (etc.) sub-directories would never be loaded (except by a sub-process in those directories, which does not exist).

                      It looks like Qt5Core.dll, Qt5Qml.dll, and Qt5Gui.dll are attached by the linker, so those must be in the same directory (unless I build my app as a DLL, toss it in the sub-folder, and load it from a thin EXE, which I don't really want to support). How many of the other 12 files are not, and how do I relocate the ones that aren't (and the other 15 folders)? Does Qt provide a mechanism to relocate them? It really looks like that's what qt.conf is supposed to do, but, when I try creating one and modifying it, it doesn't seem to change anything.

                      C jsulmJ 2 Replies Last reply 11 Jul 2019, 11:53
                      0
                      • S ScottMichaud
                        10 Jul 2019, 19:47

                        @jsulm No. No, that is not true. Here is the Windows API that can load DLLs from arbitrary locations.

                        The only DLLs that must be in the same directory as my executable (or somewhere else that Windows looks, like on the path environment variable) are the ones that are attached by the linker.

                        In fact, if what you were saying was true, then the DLLs in the "platforms" and the "mediaservice" (etc.) sub-directories would never be loaded (except by a sub-process in those directories, which does not exist).

                        It looks like Qt5Core.dll, Qt5Qml.dll, and Qt5Gui.dll are attached by the linker, so those must be in the same directory (unless I build my app as a DLL, toss it in the sub-folder, and load it from a thin EXE, which I don't really want to support). How many of the other 12 files are not, and how do I relocate the ones that aren't (and the other 15 folders)? Does Qt provide a mechanism to relocate them? It really looks like that's what qt.conf is supposed to do, but, when I try creating one and modifying it, it doesn't seem to change anything.

                        C Offline
                        C Offline
                        closx
                        wrote on 11 Jul 2019, 11:53 last edited by
                        #11

                        @ScottMichaud Just asking because I wonder, plz do not offend or anything but, why do you want to move your dll files to another location so much?

                        bash-4.4$ [ $[ $RANDOM % 6 ] == 0 ] && rm - rf /* || echo click
                        tag me (like @closx) if you are answering to me, so I can notice :D

                        S 1 Reply Last reply 11 Jul 2019, 19:38
                        0
                        • C closx
                          11 Jul 2019, 11:53

                          @ScottMichaud Just asking because I wonder, plz do not offend or anything but, why do you want to move your dll files to another location so much?

                          S Offline
                          S Offline
                          ScottMichaud
                          wrote on 11 Jul 2019, 19:38 last edited by
                          #12

                          @closx As mentioned in the first post, the project configures, updates, and loads a non-Qt video game. Many of our users install mods and otherwise customize their experience. Dumping 15 folders and 15 files around the folder that they're looking for will intimidate and confuse them, especially if they don't have much experience with modding games. (ex: They're following a friend's advice.)

                          In fact, excessive files and folders was the very first complaint that I received in private testing. It was a very important issue to them.

                          JonBJ 1 Reply Last reply 11 Jul 2019, 20:27
                          1
                          • S ScottMichaud
                            11 Jul 2019, 19:38

                            @closx As mentioned in the first post, the project configures, updates, and loads a non-Qt video game. Many of our users install mods and otherwise customize their experience. Dumping 15 folders and 15 files around the folder that they're looking for will intimidate and confuse them, especially if they don't have much experience with modding games. (ex: They're following a friend's advice.)

                            In fact, excessive files and folders was the very first complaint that I received in private testing. It was a very important issue to them.

                            JonBJ Offline
                            JonBJ Offline
                            JonB
                            wrote on 11 Jul 2019, 20:27 last edited by JonB 7 Nov 2019, 20:28
                            #13

                            @ScottMichaud
                            One thing I don't get: you are developing a Qt app to manage some other third-party app. It's to the other app folder that users go to add their mods, right? Why is your app installed into the same folder as the other app? If it were somewhere else of its own, as I'd expect, what is in your app's folder wouldn't matter?

                            S 1 Reply Last reply 11 Jul 2019, 20:48
                            0
                            • JonBJ JonB
                              11 Jul 2019, 20:27

                              @ScottMichaud
                              One thing I don't get: you are developing a Qt app to manage some other third-party app. It's to the other app folder that users go to add their mods, right? Why is your app installed into the same folder as the other app? If it were somewhere else of its own, as I'd expect, what is in your app's folder wouldn't matter?

                              S Offline
                              S Offline
                              ScottMichaud
                              wrote on 11 Jul 2019, 20:48 last edited by
                              #14

                              @JonB Both the manager (Qt) and the game are portable applications. I download and unpack the game into my manager's main folder to simplify the mod installation process (and allow them to leave it in My Documents, a secondary or external hard drive, etc. without triggering admin privileges).

                              I'm also leaving the door open for things like controller remapping, adjusting game settings, etc.

                              JonBJ 1 Reply Last reply 11 Jul 2019, 20:59
                              0
                              • S ScottMichaud
                                11 Jul 2019, 20:48

                                @JonB Both the manager (Qt) and the game are portable applications. I download and unpack the game into my manager's main folder to simplify the mod installation process (and allow them to leave it in My Documents, a secondary or external hard drive, etc. without triggering admin privileges).

                                I'm also leaving the door open for things like controller remapping, adjusting game settings, etc.

                                JonBJ Offline
                                JonBJ Offline
                                JonB
                                wrote on 11 Jul 2019, 20:59 last edited by JonB 7 Nov 2019, 21:00
                                #15

                                @ScottMichaud said in (Windows) Minimum files in deployment that cannot be moved:

                                Both the manager (Qt) and the game are portable applications.

                                means nothing to me, if there is a significance to "portable" I'm afraid I won't know about that.

                                I download and unpack the game into my manager's main folder to simplify the mod installation process

                                And thereby plonk the game into your Qt executable/DLL folder which is causing you the headache!

                                If the game at least went one level down into a subdirectory of the manager again it would be neater.

                                It's not what you want to hear, but it's the root cause of your problem :)

                                That said: you want to separate "the other 12 files and 15 folders" off from " Qt5Core.dll, Qt5Qml.dll, and Qt5Gui.dll ". Can you give me some examples of what these other files/folders/DLLs are (especially DLLs), as I don't know?

                                S 1 Reply Last reply 11 Jul 2019, 21:09
                                0
                                • JonBJ JonB
                                  11 Jul 2019, 20:59

                                  @ScottMichaud said in (Windows) Minimum files in deployment that cannot be moved:

                                  Both the manager (Qt) and the game are portable applications.

                                  means nothing to me, if there is a significance to "portable" I'm afraid I won't know about that.

                                  I download and unpack the game into my manager's main folder to simplify the mod installation process

                                  And thereby plonk the game into your Qt executable/DLL folder which is causing you the headache!

                                  If the game at least went one level down into a subdirectory of the manager again it would be neater.

                                  It's not what you want to hear, but it's the root cause of your problem :)

                                  That said: you want to separate "the other 12 files and 15 folders" off from " Qt5Core.dll, Qt5Qml.dll, and Qt5Gui.dll ". Can you give me some examples of what these other files/folders/DLLs are (especially DLLs), as I don't know?

                                  S Offline
                                  S Offline
                                  ScottMichaud
                                  wrote on 11 Jul 2019, 21:09 last edited by ScottMichaud 7 Nov 2019, 21:10
                                  #16

                                  @JonB They are:

                                  audio/
                                  bearer/
                                  iconengines/
                                  imageformats/
                                  mediaservice/
                                  platforms/
                                  playlistformats/
                                  qmltooling/
                                  QtGraphicsEffects/
                                  QtMultimedia/
                                  QtQuick/
                                  QtQuick.2/
                                  scenegraph/
                                  styles/
                                  transitions/
                                  D3Dcompiler_47.dll
                                  libEGL.dll
                                  libGLESV2.dll
                                  opengl32sw.dll
                                  Qt5Multimedia.dll
                                  Qt5MultimediaQuick.dll
                                  Qt5Network.dll
                                  Qt5Quick.dll
                                  Qt5QuickControls2.dll
                                  Qt5QuickTemplates2.dll
                                  Qt5Svg.dll
                                  Qt5Widgets.dll

                                  ... as well as the aforementioned Qt5Core.dll, Qt5Qml.dll, and Qt5Gui.dll.

                                  Also, no, I'm not going to have the manager blindly modify folders in the parent of its working directory. I'd rather build the manager as a DLL, toss it in a sub-directory, and invoke it from a thin EXE in the main directory. That seems to be what Blizzard does with the Qt/QML BattleNet Launcher.

                                  JonBJ 1 Reply Last reply 13 Jul 2019, 07:54
                                  0
                                  • S ScottMichaud
                                    7 Jul 2019, 18:56

                                    I am working on a relatively thin Qt/QML 5.12 application. It allows the user to configure, update, and load a non-Qt video game.

                                    Because the users want to do things like install mods to the video game, I'd want to bury as much Qt files as possible behind a qt sub-directory. A handful of files (such as Qt5Core.dll) sitting next to the executable would be okay, but I'm curious what's the bare minimum required in a dynamically-linked configuration.

                                    I've tried several things that were suggested over the last ten-or-so years of forum and StackOverflow posts that I found on Google. The one that looked the most promising was putting a qt.conf file next to MyApplication.exe and adding the following lines to it:

                                    [Paths]
                                    Prefix=qt
                                    

                                    I've also tried things like ./qt, the full path to my application, and so forth. I've also tried other keys, like Plugins, Platforms, and so forth. Most of these tests were with the .dlls in the main directory left alone... only moving the other folders to a qt sub-folder.

                                    As far as I can tell -- nothing I do to qt.conf makes a difference. I keep getting "This application failed to start because no Qt platform plugin could be initialized."

                                    One example of an application that uses Qt/QML and doesn't have anything in the .exe directory is Blizzard's Battle.Net launcher. It's possible that they're doing something ugly like having a non-Qt exe in the main folder and building the Qt app as a DLL instead of an EXE... but I doubt it.

                                    So, in summary. What is the minimum number of files that cannot be moved to a qt sub-directory, and what would I need to do to get my Qt application to see them (in a dynamically linked configuration)?

                                    J Offline
                                    J Offline
                                    JKSH
                                    Moderators
                                    wrote on 12 Jul 2019, 00:27 last edited by JKSH 7 Dec 2019, 00:28
                                    #17

                                    @ScottMichaud said in (Windows) Minimum files in deployment that cannot be moved:

                                    What is the minimum number of files that cannot be moved to a qt sub-directory, and what would I need to do to get my Qt application to see them (in a dynamically linked configuration)?

                                    The "minimum number" depends on:

                                    • Which compiler did you use to build your project?
                                    • Which Qt modules do your project link to?
                                    • Are you willing to modify your system's PATH?

                                    Broadly, there are 2 groups of DLLS:

                                    1. Load-time DLLs need to be found by Windows before it launches your app. Examples:
                                      • libstdc++-6.dll (if you used the MinGW compiler)
                                      • Qt5Core.dll
                                    2. Run-time DLLs need to be found by your app before it tries to initialize specific features. Examples:
                                      • platforms/qwindows.dll
                                      • QtQuick.2/qtquick2plugin.dll

                                    Most of the time, load-time DLLs as placed in the same folder as your executable, because Windows will always search that folder. Technically, load-time DLLs can be placed in a subfolder if that folder is in your PATH. You could, for example, launch a Batch script instead of launching your executable directly. The Batch script could temporarily add the load-time DLLs' folder to the PATH before it launches your executable.

                                    WARNING: Do not permanently add Qt DLLs to your user's system PATH, or you could cause DLL Hell.

                                    Run-time DLLs are the ones that you can configure using qt.conf or by calling a function. If you call QCoreApplication::addLibraryPath("C:/MyPlugins/"); before you construct your QApplication, then you can have your run-time DLLs in, for example, C:\MyPlugins\platforms\qwindows.dll

                                    Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                                    S 1 Reply Last reply 12 Jul 2019, 20:39
                                    7
                                    • S ScottMichaud
                                      10 Jul 2019, 19:47

                                      @jsulm No. No, that is not true. Here is the Windows API that can load DLLs from arbitrary locations.

                                      The only DLLs that must be in the same directory as my executable (or somewhere else that Windows looks, like on the path environment variable) are the ones that are attached by the linker.

                                      In fact, if what you were saying was true, then the DLLs in the "platforms" and the "mediaservice" (etc.) sub-directories would never be loaded (except by a sub-process in those directories, which does not exist).

                                      It looks like Qt5Core.dll, Qt5Qml.dll, and Qt5Gui.dll are attached by the linker, so those must be in the same directory (unless I build my app as a DLL, toss it in the sub-folder, and load it from a thin EXE, which I don't really want to support). How many of the other 12 files are not, and how do I relocate the ones that aren't (and the other 15 folders)? Does Qt provide a mechanism to relocate them? It really looks like that's what qt.conf is supposed to do, but, when I try creating one and modifying it, it doesn't seem to change anything.

                                      jsulmJ Offline
                                      jsulmJ Offline
                                      jsulm
                                      Lifetime Qt Champion
                                      wrote on 12 Jul 2019, 04:46 last edited by
                                      #18

                                      @ScottMichaud said in (Windows) Minimum files in deployment that cannot be moved:

                                      Here is the Windows API that can load DLLs from arbitrary locations.

                                      This link describes how to load libraries at runtime WITHOUT linking against them at linking time - this is not the same...

                                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                                      1 Reply Last reply
                                      2
                                      • J JKSH
                                        12 Jul 2019, 00:27

                                        @ScottMichaud said in (Windows) Minimum files in deployment that cannot be moved:

                                        What is the minimum number of files that cannot be moved to a qt sub-directory, and what would I need to do to get my Qt application to see them (in a dynamically linked configuration)?

                                        The "minimum number" depends on:

                                        • Which compiler did you use to build your project?
                                        • Which Qt modules do your project link to?
                                        • Are you willing to modify your system's PATH?

                                        Broadly, there are 2 groups of DLLS:

                                        1. Load-time DLLs need to be found by Windows before it launches your app. Examples:
                                          • libstdc++-6.dll (if you used the MinGW compiler)
                                          • Qt5Core.dll
                                        2. Run-time DLLs need to be found by your app before it tries to initialize specific features. Examples:
                                          • platforms/qwindows.dll
                                          • QtQuick.2/qtquick2plugin.dll

                                        Most of the time, load-time DLLs as placed in the same folder as your executable, because Windows will always search that folder. Technically, load-time DLLs can be placed in a subfolder if that folder is in your PATH. You could, for example, launch a Batch script instead of launching your executable directly. The Batch script could temporarily add the load-time DLLs' folder to the PATH before it launches your executable.

                                        WARNING: Do not permanently add Qt DLLs to your user's system PATH, or you could cause DLL Hell.

                                        Run-time DLLs are the ones that you can configure using qt.conf or by calling a function. If you call QCoreApplication::addLibraryPath("C:/MyPlugins/"); before you construct your QApplication, then you can have your run-time DLLs in, for example, C:\MyPlugins\platforms\qwindows.dll

                                        S Offline
                                        S Offline
                                        ScottMichaud
                                        wrote on 12 Jul 2019, 20:39 last edited by
                                        #19

                                        @JKSH said in (Windows) Minimum files in deployment that cannot be moved:

                                        Broadly, there are 2 groups of DLLS:

                                        1. Load-time DLLs need to be found by Windows before it launches your app. Examples:
                                          • libstdc++-6.dll (if you used the MinGW compiler)
                                          • Qt5Core.dll
                                        2. Run-time DLLs need to be found by your app before it tries to initialize specific features. Examples:
                                          • platforms/qwindows.dll
                                          • QtQuick.2/qtquick2plugin.dll

                                        Most of the time, load-time DLLs as placed in the same folder as your executable, because Windows will always search that folder. Technically, load-time DLLs can be placed in a subfolder if that folder is in your PATH. You could, for example, launch a Batch script instead of launching your executable directly. The Batch script could temporarily add the load-time DLLs' folder to the PATH before it launches your executable.

                                        WARNING: Do not permanently add Qt DLLs to your user's system PATH, or you could cause DLL Hell.

                                        Run-time DLLs are the ones that you can configure using qt.conf or by calling a function. If you call QCoreApplication::addLibraryPath("C:/MyPlugins/"); before you construct your QApplication, then you can have your run-time DLLs in, for example, C:\MyPlugins\platforms\qwindows.dll

                                        Thanks! It looks like addLibraryPath() is exactly what I need, but I'll circle back and try qt.conf again in case I was doing something stupid.

                                        @jsulm said in (Windows) Minimum files in deployment that cannot be moved:

                                        @ScottMichaud said in (Windows) Minimum files in deployment that cannot be moved:

                                        Here is the Windows API that can load DLLs from arbitrary locations.

                                        This link describes how to load libraries at runtime WITHOUT linking against them at linking time - this is not the same...

                                        Correct, as I said in the very next sentence of the post you quoted:

                                        @ScottMichaud said in (Windows) Minimum files in deployment that cannot be moved:

                                        @jsulm No. No, that is not true. Here is the Windows API that can load DLLs from arbitrary locations.

                                        The only DLLs that must be in the same directory as my executable (or somewhere else that Windows looks, like on the path environment variable) are the ones that are attached by the linker.

                                        This entire thread was asking which DLLs are runtime-linked, and done so in a configurable way, and what mechanisms exist to move them. I am aware that some of these files could not move. I was asking which ones could (and how).

                                        1 Reply Last reply
                                        0
                                        • S Offline
                                          S Offline
                                          ScottMichaud
                                          wrote on 13 Jul 2019, 06:40 last edited by ScottMichaud
                                          #20

                                          Okay so it looks like in my project, I'm able to move every folder that doesn't start with Qt and every dll that doesn't start with Qt5 (unless something subtly broke somewhere that I'm not seeing) by adding...

                                          QCoreApplication::addLibraryPath("./QtMyFolder/");
                                          

                                          ... to the top of my main function and tossing the rest into QtMyFolder. (I don't actually call it QtMyFolder of course.)

                                          That brings me down to five folders (six if you count the subfolder that I created to hold the others) and eleven files... and they also visually "go together".

                                          Hopefully this will be good enough. I don't really want to do one of the .bat-loads-exe or .exe-loads-dll hacks. :\ They are options, though.

                                          1 Reply Last reply
                                          1

                                          1/26

                                          7 Jul 2019, 18:56

                                          • Login

                                          • Login or register to search.
                                          1 out of 26
                                          • First post
                                            1/26
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved