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. Qmake: License could not be found using Jenkins as windows service with Qt5.9 where 5.6 does
Qt 6.11 is out! See what's new in the release blog

Qmake: License could not be found using Jenkins as windows service with Qt5.9 where 5.6 does

Scheduled Pinned Locked Moved Solved Installation and Deployment
3 Posts 2 Posters 4.5k 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.
  • N Offline
    N Offline
    NetZwerg
    wrote on last edited by
    #1

    We switched building from Qt5.6 to Qt5.9. This works fine using QtCreator or console on Developer Machines.

    Now switching our Build-System based on Jenkins as System Service with 5.9 always fails to find the qt license.

    We installed Qt using my credentials and we can install and update fine using the user account. Just the service user cannot find the license, which is a mandatory for running jenkins in this configuration. We already tried placing the .qt-license file to the system home directory but this did not help at all.

    How can we achive the system user's qmake calls can find a valid license?

    BuildConfig:

    echo CD
    echo %CD%
    echo USERPROFILE
    echo %USERPROFILE%
    echo USERNAME
    echo %USERNAME%
    echo.
    echo.
    echo Content of userprofile directory
    echo.
    echo.
    dir %USERPROFILE%
    echo.
    echo.
    echo --------------- Running QMake ---------------
    echo.
    mkdir build
    cd build
    set BUILDDIR=%CD%
    call C:\Qt\5.9\msvc2015\bin\qtenv2.bat
    cd %BUILDDIR%
    qmake.exe ..\source\TestBuild.pro "CONFIG+=release" && nmake qmake_all
    

    BuildLog:

    C:\Jenkins\Testbuild>echo CD 
    CD
    
    C:\Jenkins\Testbuild>echo C:\Jenkins\Testbuild 
    C:\Jenkins\Testbuild
    
    C:\Jenkins\Testbuild>echo USERPROFILE 
    USERPROFILE
    
    C:\Jenkins\Testbuild>echo C:\Windows\system32\config\systemprofile 
    C:\Windows\system32\config\systemprofile
    
    C:\Jenkins\Testbuild>echo USERNAME 
    USERNAME
    
    C:\Jenkins\Testbuild>echo TESTBUILD$ 
    TESTBUILD$
    
    C:\Jenkins\Testbuild>echo.
    
    
    C:\Jenkins\Testbuild>echo.
    
    
    C:\Jenkins\Testbuild>echo Content of userprofile directory 
    Content of userprofile directory
    
    C:\Jenkins\Testbuild>echo.
    
    
    C:\Jenkins\Testbuild>echo.
    
    
    C:\Jenkins\Testbuild>dir C:\Windows\system32\config\systemprofile 
     Volume in Laufwerk C: hat keine Bezeichnung.
     Volumeseriennummer: ---------
    
     Verzeichnis von C:\Windows\system32\config\systemprofile
    
    10.02.2016  16:34    <DIR>          .
    10.02.2016  16:34    <DIR>          ..
    10.02.2016  15:35    <DIR>          .oracle_jre_usage
    10.02.2016  14:35               251 .qt-license
                   1 Datei(en),            251 Bytes
                   3 Verzeichnis(se), 10.672.287.744 Bytes frei
    
    C:\Jenkins\Testbuild>echo.
    
    
    C:\Jenkins\Testbuild>exit 0 
    [Testbuild] $ cmd /c call C:\Windows\TEMP\hudson3453996140933717738.bat
    
    C:\Jenkins\Testbuild>echo.
    
    
    C:\Jenkins\Testbuild>echo --------------- Running QMake --------------- 
    --------------- Running QMake ---------------
    
    C:\Jenkins\Testbuild>echo.
    
    
    C:\Jenkins\Testbuild>mkdir build 
    Ein Unterverzeichnis oder eine Datei mit dem Namen "build" existiert bereits.
    
    C:\Jenkins\Testbuild>cd build 
    
    C:\Jenkins\Testbuild\build>set BUILDDIR=C:\Jenkins\Testbuild\build 
    
    C:\Jenkins\Testbuild\build>call C:\Qt\5.9\msvc2015\bin\qtenv2.bat 
    Setting up environment for Qt usage...
    Remember to call vcvarsall.bat to complete environment setup!
    Calling vcvarsall.bat now
    **********************************************************************
    ** Visual Studio 2017 Developer Command Prompt v15.0.26430.12
    ** Copyright (c) 2017 Microsoft Corporation
    **********************************************************************
    [vcvarsall.bat] Environment initialized for: 'x86'
    
    
    NOTICE  NOTICE  NOTICE  NOTICE
    
      You are not licensed to use this version of Qt.
    
      Please log into your Qt Account at https://account.qt.io/
      to renew your license.
    
      Refer to Qt Support FAQ for known resolutions in license issues:
      https://wiki.qt.io/index.php?title=KnowledgeBase:SupportFAQ
    
    NOTICE  NOTICE  NOTICE  NOTICE
    
    Project ERROR: License check failed! Giving up ...
    Build step 'Windows Batch-Datei ausführen' marked build as failure
    Finished: FAILURE
    
    1 Reply Last reply
    0
    • N Offline
      N Offline
      NetZwerg
      wrote on last edited by
      #2

      We've got an answer from the Qt support requesting to setup the QT_LICENSE_FILE environment variable.

      We now copied the .qt-licese file from the original installation user directly into the Qt installation directory

      C:\Qt\.qt-license
      

      On the begining of every batch block in Jenkins we now manually set this path as the license environment variable

      set QT_LICENSE_FILE=C:\Qt\.qt-license
      echo.
      echo --------------- Running QMake ---------------
      echo.
      mkdir build
      cd build
      set BUILDDIR=%CD%
      call C:\Qt\5.9\msvc2015\bin\qtenv2.bat
      cd %BUILDDIR%
      qmake.exe ..\source\TestBuild.pro "CONFIG+=release" && nmake qmake_all
      

      This helped us getting jenkins back to building.

      Thanks

      1 Reply Last reply
      2
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Thanks for the feedback !

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        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