1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
// Copyright (C) 2022 The Qt Company Ltd.
//
Qt Licenser daemon for Windows
Prerequisites:
cmake, Microsoft Windows SDK, MSVC <--- Download & install these first as needed
============ Build and installation
Firstly, take a note that configure/build relies on MSVC (not tested on mingw or others).
If you need, edit the build_windows.bat file from the line stating
"cmake .. -G "Visual Studio 17 2022"
That's for most current MSVC version, change as required
Put "cmd" in the search box right next to the windows start menu, right click on "Command Promt"
(that appears in the menu) and click "run as administrator". Command prompt should open now.
In the command prompt, start the build script by typing:
> build_windows.bat
Edit the qtlicd.ini file under <project root>\deploy to match your system setup
From this point forward, you need to be an admin. So if you didn't do so already, open the command prompt as an administrator.
Go back to the <project root>\deploy directory:
> cd deploy
> mkdir C:\"Program Files"\qtlicd
> copy *.* "C:\Program Files\qtlicd\"
And install the service:
> C:\"Program Files"\qtlicd\qtlicd --install
Possible error messages:
"OpenSCManager failed (5)" <<-- You're not an admin, re-open the Command Prompt as administrator.
"CreateService failed (1073)" <<-- Service is already installed/running. See below how to stop and delete
the old service if you want to reinstall it.
"CreateService failed (1072) <<-- Service is deleted but still running. Stop it from Windows Services.
Like with Linux version, you now need to get the MOC-wrapper and Qt5 licheck binaries replaced:
- Find your Qt installation's binary path and cd there (still using the admin CMD prompt)
(For example, my path is: "C:\Qt\6.3.1\mingw_64\bin)
> cd <Qt instalation binary path>
> move moc.exe orig_moc.exe <--- Name MUST be orig_moc.exe
> mklink moc.exe "C:\Program\files\qtlicd\mocwrapper.exe"
- And the same for licheck, if you're using Qt5:
> move licheck.exe licheck_bak.exe <---- Name it freely
> mklink licheck.exe "C:\Program\files\qtlicd\licheck.exe"
If you use command line a lot, you may like to add "C:\Program Files\qtlicd\" in your PATH variable for convenience.
============ Starting/stopping the service:
In Windows start menu search, type:
"Services"
Icon with name "Services" should appear. Open it, and a list of system services should now be seen.
Scroll down until you see "qtlicd". Click it to activate, and then click "Start the service" near upper left corner of the window.
From the same place, you also can stop it whenever needed.
============ Uninstall:
From Administrator Command propmt, call the lidc as follows:
> C:\"Program Files"\qtlicd\qtlicd --delete
The qtlicd service disappears from the Windows Services and you now can do re-installation if needed.
Please note that this does NOT delete the program itself, it's still in its designated folder.
To completely remove it, just destroy the "c:\Program Files\qtlicd" directory and replace the orig_moc and licheck binaries with the originals.
|