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. How does the Qt Win32 binary installer Qt relocation
Forum Updated to NodeBB v4.3 + New Features

How does the Qt Win32 binary installer Qt relocation

Scheduled Pinned Locked Moved Installation and Deployment
5 Posts 4 Posters 4.3k 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.
  • U Offline
    U Offline
    Uwe Kindler
    wrote on last edited by
    #1

    If I built Qt from sources, then it is not possible to relocate Qt because the build directory is hardcoded into the Qt libraries. So distributing my Qt version to other co workers in our company is not easy (the qt.conf way does not work with Qt Creator). So it would be really interesting to know how the Qt Win32 binary installer does the relocation trick? Any idea?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Smar
      wrote on last edited by
      #2

      Are you talking about *nixes? There is flag -prefix for configure script.

      1 Reply Last reply
      0
      • F Offline
        F Offline
        Felix
        wrote on last edited by
        #3

        that would still be interesting, if someone from nokia could post a reply here

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Smar
          wrote on last edited by
          #4

          Since there after all seems to be interest about this, I’ll post few things.

          On nixes, there is quite many ways to do this. Most favorable way is to have library paths in system configure files (ld.conf.so and so on), which specifies the paths where missing libraries will be looked from. That is, they are first tried to load from current directory, IIRC.

          Then one can specify LD_LIBRARY_PATH to specify list of paths where the libs should be loaded from. This overrides the paths specified in configs.

          Then one can use runpaths/rpaths to specify fixed location where is this library’s dependecy files. By its nature, it should be clear that this is not good way. It also overrides all stuff specified with above methods.

          On Windows, all of this is controlled using variable named PATH. I haven’t really got why, but that’s how it’s done there.

          1 Reply Last reply
          0
          • C Offline
            C Offline
            craigtrane24
            wrote on last edited by
            #5

            The PATH environment variable is the way to go, but it's pretty simple to patch the core binary in-place for other paths. If you look at "src\corelib\global\qconfig.cpp", you'll see that all library/plugin/doc/etc locations are null-terminated into 524-length arrays; this was obviously done with patching in mind. I imagine the installer patches QtCore4.dll at those array locations to include the install location. Since each array begins with the 12-character string "qt_XXXXpath=", you can patch it with a directory length up to 511 characters before overflowing :). Just make sure to double-backslash the path separator.

            1 Reply Last reply
            0

            • Login

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