@@ -4,139 +4,128 @@ title: How to use offline registration license type?
4
4
keywords : Dynamsoft Barcode Reader, FAQ, offline, license type
5
5
description : How to use offline registration license type?
6
6
needAutoGenerateSidebar : false
7
+ permalink : /faq/general/offline-registration-license.html
7
8
---
8
9
9
10
## How to use offline registration license type?
10
11
11
12
[ << Back to FAQ index] ( index.md )
12
13
14
+
13
15
You can follow the steps below to manually register the device and get the license key for each device:
14
16
15
17
1 . Log in [ Customer Portal] ( https://www.dynamsoft.com/customer/license/fullLicense ) -> Click the Activate button to activate the license
16
- ![ activate] ( ./assets/activate.jpg )
18
+ ![ activate] ( ./assets/activate.jpg )
19
+
17
20
18
21
2 . Select the 3rd option "No License Server. Register Offline Device(s) Manually" and click Activate.
19
- ![ offline-activate] ( ./assets/offline-activate.jpg )
22
+ ![ offline-activate] ( ./assets/offline-activate.jpg )
20
23
21
24
3 . Click the Add Device button then it will pop up a dialog. Download the tool from the pop up.
22
- ![ uuid-tool] ( ./assets/uuid-tool.jpg )
25
+ ![ uuid-tool] ( ./assets/uuid-tool.jpg )
23
26
24
27
4 . Unzip the file and run the GenerateUUID tool on the device to be registered and get the UUID.<br >
25
28
26
- For Windows:<br >
27
- -Open Command Prompt (cmd.exe)<br >
28
- -Change the working directory to the one where GenerateUUID.exe is<br >
29
- -Run the command ` GenerateUUID.exe ` <br >
30
- The returned string, e.g. 8ECCA3B6-66F9-4fd6-B6B6-308C874140C6, is the machine ID.<br >
31
- ![ uuid] ( ./assets/uuid.jpg ) <br >
32
-
33
- For Linux:<br >
34
- -Open Terminal<br >
35
- -Change the working directory to the one where GenerateUUID.exe is<br >
36
- -Run the command ` sudo chmod 777 GenerateUUID ` <br >
37
- -After inputting the password, run ` ./GenerateUUID ` <br >
38
-
39
- You will see the generated UUID like this (the ID should be different)<br >
40
- SoftbindUUID:230e089a-7dc3-4caa-9c77-f7cc6d567f9b<br >
41
- "230e089a-7dc3-4caa-9c77-f7cc6d567f9b" is the generated UUID. You can now use it to register the device and get an Authorization String for it.<br >
42
-
43
- > Note: If your device is an arm based architecture, please use get device uuid API to generate the uuid:
44
- >
45
- > ``` python
46
- > # sample code in python
47
- > print (BarcodeReader.get_device_uuid(1 ))
48
- > ```
49
-
50
- > Note: If you want multiple users in operating system to use the license , you will need to move the .Dynamsoft folder to a path where all the users can access. Let us say `/ Home/ shared/ .Dynamsoft` .
51
- > For all the programs in the devices, you will need to set the license cache path to `/ Home/ shared` before initialize the license
52
- >
53
- > ```python
54
- > # set license cache path before initialize the license
55
- > BarcodeReader.set_license_cache_path(" /Home/shared" )
56
- > ```
29
+ ## For Windows:
30
+
31
+ 1 . Open Command Prompt (cmd.exe)
32
+ 2 . Change the working directory to the one where ` GenerateUUID.exe ` is located
33
+ 3 . Run the command: ` GenerateUUID.exe `
34
+
35
+ The returned string, e.g. ` 8ECCA3B6-66F9-4fd6-B6B6-308C874140C6 ` , is the machine ID.
36
+
37
+ ![ uuid] ( ./assets/uuid.jpg )
38
+
39
+ ## For Linux:
40
+
41
+ 1 . Open Terminal
42
+ 2 . Change the working directory to the one where ` GenerateUUID ` is located
43
+ 3 . Run the command: ` sudo chmod 777 GenerateUUID `
44
+ 4 . After inputting the password, run: ` ./GenerateUUID `
45
+
46
+ You will see the generated UUID like this (the ID should be different):
47
+
48
+ ```
49
+ SoftbindUUID: 230e089a-7dc3-4caa-9c77-f7cc6d567f9b
50
+ ```
51
+
52
+ ` 230e089a-7dc3-4caa-9c77-f7cc6d567f9b ` is the generated UUID. You can now use it to register the device and get an Authorization String for it.
53
+
54
+ > Note: If your device is an ARM-based architecture, please use get device uuid API to generate the uuid:
55
+ > ``` python
56
+ > # sample code in python
57
+ > print (BarcodeReader.get_device_uuid(1 ))
58
+ > ```
59
+
60
+ > Note: If you want multiple users in operating system to use the license , you will need to move the Dynamsoft folder to a path where all the users can access. Let us say `/ Home/ shared/ .Dynamsoft` .
61
+ > For all the programs in the devices, you will need to set the license cache path to `/ Home/ shared` before initializing the license
62
+ > ```python
63
+ > # set license cache path before initialize the license
64
+ > BarcodeReader.set_license_cache_path(" /Home/shared" )
65
+ > ```
66
+
57
67
58
68
5 . Input the generated UUID and device name and click Submit.
59
- 
69
+ 
60
70
61
71
6 . Then an authorization string will be generated. This string is the license for this device. Copy the license and set it in the code
62
- 
72
+ 
63
73
64
74
Code snippet in JavaScript:
65
-
66
75
```javascript
67
76
Dynamsoft.DBR .BarcodeScanner.license = " DLC2+4LgkxoZik5yCuJxMDneqJPVQZJROL…" ;
68
77
let scanner = await Dynamsoft.DBR .BarcodeScanner.createInstance();
69
78
```
70
79
71
80
Code snippet in C:
72
-
73
81
``` C
74
82
char errorBuf[512 ];
75
83
DBR_InitLicense ("DLC2+4LgkxoZik5yCuJxMDneqJPVQZJROL…", errorBuf, 512);
76
84
void* barcodeReader = DBR_CreateInstance();
77
85
// add further process
78
86
```
79
-
80
87
Code snippet in C++
81
-
82
88
```C++
83
- char errorBuf[512];
84
- dynamsoft::dbr::CBarcodeReader::InitLicense("DLC2+4LgkxoZik5yCuJxMDneqJPVQZJROL …", errorBuf, 512);
85
- CBarcodeReader* reader = new CBarcodeReader();
89
+ errorCode = CLicenseManager::InitLicense("YOUR-LICENSE-KEY", szErrorMsg, 256);
90
+ if (errorCode != ErrorCode::EC_OK && errorCode != ErrorCode::EC_LICENSE_CACHE_USED)
91
+ {
92
+ cout << "License initialization failed: ErrorCode: " << errorCode << ", ErrorString: " << szErrorMsg << endl;
93
+ }
94
+ else
95
+ {
96
+ // other codes...
97
+ }
86
98
// add further process
87
99
```
88
-
89
100
Code snippet in C#:
90
-
91
101
``` C#
92
- string errorMsg ;
93
- BarcodeReader .InitLicense (" DLC2+4LgkxoZik5yCuJxMDneqJPVQZJROL…" , out errorMsg );
94
- BarcodeReader reader = new BarcodeReader ();
95
- // add further process
102
+ errorCode = LicenseManager .InitLicense (" YOUR-LICENSE-KEY" , out errorMsg );
103
+ if (errorCode != (int )EnumErrorCode .EC_OK && errorCode != (int )EnumErrorCode .EC_LICENSE_CACHE_USED )
104
+ {
105
+ Console .WriteLine (" License initialization error: " + errorMsg );
106
+ }
107
+ else
108
+ {
109
+ CaptureVisionRouter cvr = new CaptureVisionRouter ();
110
+ // add code for further process
111
+ }
96
112
```
97
-
98
113
Code snippet in Java:
99
-
100
114
``` Java
101
- BarcodeReader . initLicense(" DLC2+4LgkxoZik5yCuJxMDneqJPVQZJROL…" );
102
- BarcodeReader reader = new BarcodeReader ();
103
- // add further process
115
+ LicenseError licenseError = LicenseManager . initLicense(" YOUR-LICENSE-KEY" );
116
+ if (licenseError. getErrorCode() != EnumErrorCode . EC_OK &&
117
+ licenseError. getErrorCode() != EnumErrorCode . EC_LICENSE_CACHE_USED ) {
118
+ System . out. println(" License initialization error: " + licenseError. getErrorString());
119
+ } else {
120
+ CaptureVisionRouter cvrInstance = new CaptureVisionRouter ();
121
+ // add code for further process
122
+ }
104
123
```
105
-
106
124
Code snippet in Python:
107
-
108
125
``` Python
109
- error = BarcodeReader.init_license(" DLC2+4LgkxoZik5yCuJxMDneqJPVQZJROL…" )
110
- dbr = BarcodeReader()
111
- ```
112
-
113
- Code snippet in Android SDK:
114
-
115
- ``` java
116
- BarcodeReader . initLicense(" DLC2+4LgkxoZik5yCuJxMDneqJPVQZJROL…" , new DBRLicenseVerificationListener () {
117
- @Override
118
- public void DBRLicenseVerificationCallback (boolean isSuccessful , Exception e ) {
119
- // Add your code for license verification.
120
- }
121
- });
122
- ```
123
-
124
- Code snippet in Objective-C:
125
-
126
- ``` Objective-C
127
- [DynamsoftBarcodeReader initLicense: @" DLC2+4LgkxoZik5yCuJxMDneqJPVQZJROL…" verificationDelegate: self ] ;
128
- - (void)DBRLicenseVerificationCallback:(bool)isSuccess error:(NSError * )error
129
- {
130
- // Add your code for license verification.
131
- }
132
- ```
133
-
134
- Code snippet in Swift:
135
-
136
- ```Swift
137
- DynamsoftBarcodeReader.initLicense("DLC2+4LgkxoZik5yCuJxMDneqJPVQZJROL…", verificationDelegate: self)
138
- func dbrLicenseVerificationCallback(_ isSuccess: Bool, error: Error?)
139
- {
140
- // Add your code for license verification.
141
- }
126
+ error_code, error_msg = LicenseManager.init_license(" YOUR-LICENSE-KEY" )
127
+ if error_code != EnumErrorCode.EC_OK .value and error_code != EnumErrorCode.EC_LICENSE_CACHE_USED .value:
128
+ print (" License initialization error: " + error_msg)
129
+ else :
130
+ cvr_instance = CaptureVisionRouter()
142
131
```
0 commit comments