Results 1 to 17 of 17

Thread: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it

  1. #1
    Join Date
    Jul 2007
    Location
    Russia, Ul'yanovsk
    Posts
    20
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it

    When I install this distribution I type some install path, for example d:\qt\4.3.1-shared, in one of install wizard pages. When installation is complete I found that d:\qt\4.3.1-shared\bin\qmake.exe has this install path hard-coded into it. So I would like to know how they do it?

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it

    How do you know it is hardcoded?
    EDIT:
    would it be because qmake -v outputs something like:
    QMake version 2.01a
    Using Qt version 4.3.0 in D:\dev\Qt\4.3.0\lib

    The version is not hardcoded. It must check the QTDIR variable.
    Last edited by marcel; 1st October 2007 at 17:07.

  3. #3
    Join Date
    Jul 2007
    Location
    Russia, Ul'yanovsk
    Posts
    20
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it

    Quote Originally Posted by marcel View Post
    would it be because qmake -v outputs something like...
    Нет, блин, не поэтому. It because I open qmake.exe as text file and found these path strings there

    These strings I found in qmake.exe after mentioned in subj distr was installed in f:\qt\4.3.1-g++:

    qt_prfxpath=F:\qt\4.3.1-g++
    qt_docspath=F:\qt\4.3.1-g++\doc
    qt_hdrspath=F:\qt\4.3.1-g++\include
    qt_libspath=F:\qt\4.3.1-g++\lib
    qt_binspath=F:\qt\4.3.1-g++\bin
    qt_plugpath=F:\qt\4.3.1-g++\plugins
    qt_datapath=F:\qt\4.3.1-g++
    qt_trnspath=F:\qt\4.3.1-g++\translations
    qt_xmplpath=F:\qt\4.3.1-g++\examples
    qt_demopath=F:\qt\4.3.1-g++\demos
    Last edited by QCasper; 1st October 2007 at 18:13.

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it

    Нет, блин, не поэтому.
    What does that mean?

    Anyway, qmake is compiled on the fly, by the installer. That is why/how the paths get in there.

  5. #5
    Join Date
    Jul 2007
    Location
    Russia, Ul'yanovsk
    Posts
    20
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it

    Quote Originally Posted by marcel View Post
    What does that mean?
    This mean "No, not therefore"

    Quote Originally Posted by marcel View Post
    Anyway, qmake is compiled on the fly, by the installer. That is why/how the paths get in there.
    So, I would like to know details, compiling qmake is not quick task, but installation runs quite quickly.

  6. #6
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it

    HThe qmake project is not big and it does not take a long time to compile. You can check for that yourself. See the qmake dir in your QTDIR.
    I assume that qmake is compiled after mingw is downloaded/installed. That is the only explanation.

  7. #7
    Join Date
    Jul 2007
    Location
    Russia, Ul'yanovsk
    Posts
    20
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it

    Compiling qmake manualy takes more time than installing from that distr.

  8. #8
    Join Date
    Jul 2007
    Location
    Russia, Ul'yanovsk
    Posts
    20
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it

    Quote Originally Posted by marcel View Post
    I assume that qmake is compiled after mingw is downloaded/installed. That is the only explanation.
    That is not only one explanation. I have learn details during instalation process and I can to say following:

    1. Almost all is "Extracting <some file>...";
    2. At the last steps there are many "Pathing <some name>.prl...";
    3. And finaly there are two strings in details: "Patching paths in qmake..." and "Patching paths in core...".

    So you can see nowhere is compiling qmake.

    I would like to know what they do at that patching step (qmake and core patching).
    Last edited by QCasper; 2nd October 2007 at 12:59.

  9. #9
    Join Date
    Jul 2007
    Location
    Russia, Ul'yanovsk
    Posts
    20
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it

    So, no ideas?

  10. #10
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it

    The behaviour is correct
    -> qt.conf is your friend

  11. #11
    Join Date
    Jul 2007
    Location
    Russia, Ul'yanovsk
    Posts
    20
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it

    Quote Originally Posted by ChristianEhrlicher View Post
    The behaviour is correct
    -> qt.conf is your friend
    I prefer don't use qt.conf. I would like to do it using the same way as trolls - to patch qmake and core.

  12. #12
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it

    But what if the patching is done by the installer?
    Look at option.h, from the qmake project:
    Qt Code:
    1. {
    2. public:
    3. enum LibraryLocation
    4. {
    5. PrefixPath,
    6. DocumentationPath,
    7. HeadersPath,
    8. LibrariesPath,
    9. BinariesPath,
    10. PluginsPath,
    11. DataPath,
    12. TranslationsPath,
    13. SettingsPath,
    14. DemosPath,
    15. ExamplesPath
    16. };
    17. static QString location(LibraryLocation);
    18. };
    To copy to clipboard, switch view to plain text mode 
    This is the class used to access the paths. It is a minimal version of QLibraryInfo.

    The paths are written by (and ONLY by) configure. Take a look in configureapp.cpp( from tools) in function Configure::generateConfigfiles(). Here is the only time those values are written somewhere.

    This leads me to believe that the installer actually uses configure to initially configure the destination paths, and it modifies qmake.

    There is no other explanation, or I don't see it right now.
    Last edited by marcel; 4th October 2007 at 07:43.

  13. #13
    Join Date
    Jul 2007
    Location
    Russia, Ul'yanovsk
    Posts
    20
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it

    Today I wrote patch that patchs qmake and QtCore(d)4.dll. It was written using Qt so it takes just about 50 lines of code. It's realy works but one issue is still remain. At debugging I can't step into any Qt function (or class method) because it tries to use old src dir.

  14. #14
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it

    The code for patching qmake was already in configureapp.cpp.
    And why would you need to patch Qt yourself... Should have asked that from the beginning.

  15. #15
    Join Date
    Jul 2007
    Location
    Russia, Ul'yanovsk
    Posts
    20
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it

    Quote Originally Posted by marcel View Post
    The code for patching qmake was already in configureapp.cpp.
    And why would you need to patch Qt yourself... Should have asked that from the beginning.
    First of all, I didn't know that patch code in that file. Second, it is more easy to write my own code than to find it there.
    I would need to patch Qt myself because I want to create my own installer.

  16. #16
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it

    Second, it is more easy to write my own code than to find it there.
    It would have been faster if you just reused that code.
    That's the whole idea of open source.

  17. #17
    Join Date
    Jul 2007
    Location
    Russia, Ul'yanovsk
    Posts
    20
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qt-win-opensource-4.3.1-mingw.exe - qmake has my install path hard-coded into it

    Quote Originally Posted by marcel View Post
    It would have been faster if you just reused that code.
    That's the whole idea of open source.
    First reason is main reason (I didn't know).

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.