@@ -4,139 +4,128 @@ title: How to use offline registration license type?
44keywords : Dynamsoft Barcode Reader, FAQ, offline, license type
55description : How to use offline registration license type?
66needAutoGenerateSidebar : false
7+ permalink : /faq/general/offline-registration-license.html
78---
89
910## How to use offline registration license type?
1011
1112[ << Back to FAQ index] ( index.md )
1213
14+
1315You can follow the steps below to manually register the device and get the license key for each device:
1416
15171 . 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+
1720
18212 . 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 )
2023
21243 . 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 )
2326
24274 . Unzip the file and run the GenerateUUID tool on the device to be registered and get the UUID.<br >
2528
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+
5767
58685 . Input the generated UUID and device name and click Submit.
59- 
69+ 
6070
61716 . 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+ 
6373
6474Code snippet in JavaScript:
65-
6675```javascript
6776Dynamsoft.DBR .BarcodeScanner.license = " DLC2+4LgkxoZik5yCuJxMDneqJPVQZJROL…" ;
6877let scanner = await Dynamsoft.DBR .BarcodeScanner.createInstance();
6978```
7079
7180Code snippet in C:
72-
7381``` C
7482 char errorBuf[512 ];
7583 DBR_InitLicense ("DLC2+4LgkxoZik5yCuJxMDneqJPVQZJROL…", errorBuf, 512);
7684 void* barcodeReader = DBR_CreateInstance();
7785 // add further process
7886```
79-
8087Code snippet in C++
81-
8288```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+ }
8698 // add further process
8799```
88-
89100Code snippet in C#:
90-
91101``` 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+ }
96112```
97-
98113Code snippet in Java:
99-
100114``` 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+ }
104123```
105-
106124Code snippet in Python:
107-
108125``` 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()
142131```
0 commit comments