Install Qt License Service manually
By default, Qt License Service is automatically installed as an on-demand service when you install any Qt or Quality Assurance product with Qt Online Installer.
However, sometimes you might need a different launching method for Qt License Service. In these cases, you can install Qt License Service manually. Manually installed Qt License Service can operate either as a system service, as an on-demand service, or as a user-space process.
Prerequisites
Make sure the following tools are installed:
- CMake
- libcurl-openssl-dev
- build-essential
- libuuid
To install them, run the following command:
sudo apt install cmake libcurl4-openssl-dev build-essential uuid-dev
- Xcode
- CMake
- CMake
- Perl (for example Strawberry Perl)
- Netwide Assembler (NASM)
- OpenSSL (static build)
- Microsoft Windows SDK
- MSVC
Build OpenSSL before building Qt License Service:
- Fetch the sources from the OpenSSL website.
- Extract the sources to
C:\openssl\
.
- Extract the sources to
- Configure the sources for a static build:
- Open the developer command prompt for the MSVC version you are using.
- Change directory to the extracted sources:
cd C:\openssl\
- Run the configure script:
perl Configure no-shared no-pinshared
- Build OpenSSL
- In the developer command prompt, run:
nmake
- In the developer command prompt, run:
Install using Qt Online Installer
First, download Qt Online Installer from your Qt Account.
- Open Qt Online Installer.
- Select Custom Installation.
- In Select Components > License Management Tools > Qt License Service, select the correct Qt License Service version.
- Select Next and follow the instructions of the installer.
Install using Qt Maintenance Tool
Qt Maintenance Tool is included in each Qt installation. If you already have Qt, use Qt Maintenance Tool to install Qt License Service.
- Open Qt Maintenance Tool.
- Select Add or remove components.
- In License Management Tools > Qt License Service, select the correct Qt License Service version.
- Select Next and follow the instructions of the installer to complete the installation.
Build Qt License Service from sources
To build Qt License Service from sources:
- Set the
OPENSSL_ROOT_DIR
variable to point to the OpenSSL installation:export OPENSSL_ROOT_DIR=</path/to/your/openssl/installation>
- Make sure you are in the project root folder and run the build script:
./build_unix.sh
- Set the
OPENSSL_ROOT_DIR
variable to point to the OpenSSL installation:export OPENSSL_ROOT_DIR=</path/to/your/openssl/installation>
- Make sure you are in the project root folder and run the build script:
./build_unix.sh
- Set the
OPENSSL_ROOT_DIR
variable to point to the OpenSSL installation:set OPENSSL_ROOT_DIR=C:\openssl\
- Make sure you are in the project root folder and start the build script:
build_windows.bat
If the default CMake generator does not match the desired Visual Studio version, add the Visual Studio version as a parameter to the build script:
build_windows.bat "Visual Studio 17 2022"
Configure the server address
To configure the server address:
Edit the qtlicd.ini file in the deploy directory:
- Set the value of
server_addr
to the address and port of Qt License Server. The default is the cloud instance hosted by Qt. If you're using an on-premises server, set the address accordingly. - Set the value of
ca_bundle_path
to the absolute path to CA bundle file orauto
for automatic detection. Automatic detection tries to first find a CA bundle file from predefined search paths, and if that fails,/etc/ssl/certs
will be used as a fallback for looking for an individual certificate file to verify the peer with. - Set the value of
tcp_listening_port
to the correct port if the default value is not suitable when using the on-premises Qt License Server.
Edit the qtlicd.ini file in the deploy directory:
- Set the value of
server_addr
to the address and port of Qt License Server. The default is the cloud instance hosted by Qt. If you're using an on-premises server, set the address accordingly. - Set the value of
ca_bundle_path
to the absolute path to CA bundle file orauto
for automatic detection. Automatic detection tries to first find a CA bundle file from predefined search paths, and if that fails,/etc/ssl/certs
will be used as a fallback for looking for an individual certificate file to verify the peer with. - Set the value of
tcp_listening_port
to the correct port if the default value is not suitable when using the on-premises Qt License Server.
- Edit the qtlicd.ini file in the deploy directory:
- Set the value of
server_addr
to the address and port of Qt License Server. The default is the cloud instance hosted by Qt. If you're using an on-premises server, set the address accordingly. - Set the value of
tcp_listening_port
to the correct port if the default value is not suitable when using the on-premises Qt License Server.
- Set the value of
- Copy the Qt License Service files to the destination path:
- Open the command prompt as an administrator.
- Go to the
<project root>\deploy
directory. - Copy the files:
mkdir C:\"Program Files"\qtlicd
copy *.* C:\"Program Files"\qtlicd\
Operating modes
Qt License Service can operate in the following modes:
Operating mode | Description |
---|---|
A system service | Running always on the background as a system service and available for all users on the computer. Requires admin privileges. |
An on-demand service | Launched automatically when a license reservation is required. |
A user-space process | The user is responsible for starting and shutting down the service. Mainly for testing purposes. |
Note: When you start the Qt License Service executable (qtlicd(.exe)), it reads settings from the installation folder.
Install as a system service
To run Qt License Service as a system service:
Run the installation script as root and start the service:
$ sudo ./installer.sh
Qt License Service starts automatically after reboot.
Run the installation script as root and start the service:
$ sudo ./installer.sh
Qt License Service starts automatically after reboot.
Run the installation script as an administrator:
C:\"Program Files"\qtlicd\qtlicd --install
Possible error messages:
Error message | Solution |
---|---|
OpenSCManager failed (5) | You're not an administrator. Re-open the command prompt as administrator. |
CreateService failed (1073) | Qt License Service is already installed or running. If you want to reinstall Qt License Service, stop and delete the old installation first. |
CreateService failed (1072) | Qt License Service is deleted but still running. Stop it from Windows Services. |
Install as an on-demand service
To run Qt License Service as an on-demand service:
- Copy the qtlicd executable to a preferred destination folder (<user>):
cd deploy (created by the build_unix.sh) mkdir /home/<user>/qtlicd cp qtlicd mocwrapper licheck qtlicensetool /home/<user>/qtlicd/
- Copy the service configuration file qtlicd.ini in place for on-demand launch:
mkdir -p /home/<user>/.local/share/Qt/qtlicd cp qtlicd.ini /home/<user>/.local/share/Qt/qtlicd
- Register the qtlicd executable for on-demand start. Optionally, add
<optional argument>
to specify the source (for exampleadmin
orjohn
):cd /home/<user>/qtlicd/ ./qtlicd --register <optional argument>
- Verify that the registration succeeded:
cat /home/<user>/.local/share/Qt/qtlicd/installations.ini
- Copy the qtlicd executable to a preferred destination folder (<user>):
cd deploy (created by the build_unix.sh) mkdir /home/<user>/qtlicd cp qtlicd mocwrapper licheck qtlicensetool /home/<user>/qtlicd/
- Copy the service configuration file qtlicd.ini in place for on-demand launch:
mkdir -p $HOME/Library/Application Support/Qt/qtlicd cp qtlicd.ini $HOME/Library/Application Support/Qt/qtlicd
- Register the qtlicd executable for on-demand start. Optionally, add
<optional argument>
to specify the source (for exampleadmin
orjohn
):cd /home/<user>/qtlicd/ ./qtlicd --register <optional argument>
- Verify that the registration succeeded:
cat $HOME/Library/Application Support/Qt/qtlicd/installations.ini
- Copy the service configuration file qtlicd.ini in place for on-demand start:
mkdir C:\Users\<user>\AppData\Roaming\Qt\qtlicd copy qtlicd.ini C:\Users\<user>\AppData\Roaming\Qt\qtlicd\
- Register the qtlicd.exe executable for on-demand start. Optionally, add
<optional argument>
to specify the source (for exampleadmin
orjohn
):cd C:\"Program Files"\qtlicd qtlicd.exe --register <optional argument>
- Verify that the registration succeeded:
type C:\Users\<user>\AppData\Roaming\Qt\qtlicd\installations.ini
Install as a user-space process
To run Qt License Service as a user-space process, make sure Qt License Service is not running. Then, from the command line, go to the directory where Qt License Service is installed, and enter:
./qtlicd --mode cli
./qtlicd --mode cli
qtlicd.exe --mode cli
Stop the service like any other app with Ctrl+C.
Note: This is recommended only for testing purposes or if it is not possible to install Qt License Service as a system service.
Enable license reservations for Qt 5 and Qt 6
Because the installation script does not know your Qt installation path, you must set up the moc
wrapper (something like /home/user/Qt/6.3.1/gcc_64/) for each Qt installation path you need the license check enabled for. For more information about moc
, see moc documentation.
Qt 5:
cd <your Qt installation path>/bin
Qt 6:
cd <your Qt installation path>/libexec
mv moc qtmoc # Name has to be qtmoc
When using Qt License Service as a system service:
ln -s /opt/qtlicd/mocwrapper moc
When using Qt License Service as an on-demand service:
ln -s /home/<user>/qtlicd/mocwrapper moc
mv moc qtmoc # Name has to be qtmoc
When using Qt License Service as a system service:
ln -s /opt/qtlicd/mocwrapper moc
When using Qt License Service as an on-demand service:
ln -s /home/<user>/qtlicd/mocwrapper moc
move moc.exe qtmoc.exe # Name has to be qtmoc.exe mklink moc.exe "C:\Program Files\qtlicd\mocwrapper.exe"
To check that you set the installation path correctly, build any Qt application with any IDE or from the command line.
Disable legacy license check (Qt 5)
To disable legacy support for the Qt 5 qmake licensing system, replace the licheck
binary with the provided one:
In <your Qt installation path>/bin
:
ln -s /opt/qtlicd/licheck licheck
When using Qt License Service as a system service:
ln -s /opt/qtlicd/licheck licheck
When using Qt License Service as an on-demand service:
ln -s /home/<user>/qtlicd/licheck licheck
In <your Qt installation path>/bin
:
ln -s /opt/qtlicd/licheck licheck
When using Qt License Service as a system service:
ln -s /opt/qtlicd/licheck licheck
When using Qt License Service as an on-demand service:
ln -s /home/<user>/qtlicd/licheck licheck
In <your Qt installation path>/bin
:
move licheck.exe licheck_bak.exe mklink licheck.exe "C:\Program Files\qtlicd\licheck.exe"
© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.