Skip to content

Commit

Permalink
Merge pull request #66 from cryptlex/permission-flags
Browse files Browse the repository at this point in the history
chore: add LA_ALL_USERS permission flag
ahmad-kemsan authored Apr 23, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents ce89a2b + 90b937b commit 5e5c131
Showing 2 changed files with 25 additions and 7 deletions.
13 changes: 9 additions & 4 deletions src/lexactivator.ts
Original file line number Diff line number Diff line change
@@ -156,9 +156,13 @@ export class LexActivator {
*
* @param {string} productId the unique product id of your application as mentioned on
* the product page in the dashboard.
* @param {PermissionFlags} flag depending upon whether your application requires admin/root
* permissions to run or not, this parameter can have one of the following values:
* LA_SYSTEM, LA_USER, LA_IN_MEMORY
* @param {PermissionFlags} flag depending on your application's requirements, choose one of
* the following values: LA_USER, LA_SYSTEM, LA_IN_MEMORY, LA_ALL_USERS.
* - LA_USER: This flag indicates that the application does not require admin or root permissions to run.
* - LA_SYSTEM: This flag indicates that the application must be run with admin or root permissions.
* - LA_IN_MEMORY: This flag will store activation data in memory. Thus, requires re-activation
* on every start of the application and should only be used in floating licenses.
* - LA_ALL_USERS: This flag is specifically designed for Windows and should be used for system-wide activations.
* @throws {LexActivatorException}
*/
static SetProductId(productId: string, flag: typeof PermissionFlags[keyof typeof PermissionFlags]): void {
@@ -1545,7 +1549,8 @@ export class LexActivator {
export const PermissionFlags = {
'LA_USER': 1,
'LA_SYSTEM': 2,
'LA_IN_MEMORY': 4
'LA_ALL_USERS': 3,
'LA_IN_MEMORY': 4,
};

export const ReleaseFlags = {
19 changes: 16 additions & 3 deletions src/native/LexActivator.h
Original file line number Diff line number Diff line change
@@ -63,6 +63,7 @@ typedef void (LA_CC *ReleaseCallbackType)(uint32_t, CSTRTYPE, void*);

#define LA_USER ((uint32_t)1)
#define LA_SYSTEM ((uint32_t)2)
#define LA_ALL_USERS ((uint32_t)3)
#define LA_IN_MEMORY ((uint32_t)4)

#define LA_RELEASES_ALL ((uint32_t)1)
@@ -120,9 +121,21 @@ LEXACTIVATOR_API int LA_CC SetProductData(CSTRTYPE productData);
* productId - the unique product id of your application as mentioned
on the product page in the dashboard.
* flags - depending upon whether your application requires admin/root
permissions to run or not, this parameter can have one of the following
values: LA_SYSTEM, LA_USER, LA_IN_MEMORY
* flags - depending on your application's requirements, choose one of
the following values: LA_USER, LA_SYSTEM, LA_IN_MEMORY, LA_ALL_USERS.
- LA_USER: This flag indicates that the application does not require
admin or root permissions to run.
- LA_SYSTEM: This flag indicates that the application must be run with admin or
root permissions.
- LA_IN_MEMORY: This flag will store activation data in memory. Thus, requires
re-activation on every start of the application and should only be used in floating
licenses.
- LA_ALL_USERS: This flag is specifically designed for Windows and should be used
for system-wide activations.
RETURN CODES: LA_OK, LA_E_WMIC, LA_E_PRODUCT_FILE, LA_E_PRODUCT_DATA, LA_E_PRODUCT_ID,
LA_E_SYSTEM_PERMISSION

0 comments on commit 5e5c131

Please sign in to comment.