Skip to content

DOCINFRA-2341_merged_using_automation #1466

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion wpf/Licensing/how-to-register-in-an-application.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY
N> * Place the license key between double quotes. Also, ensure that Syncfusion.Licensing.dll is referenced in your project where the license key is being registered.
* Syncfusion license validation is done offline during application execution and does not require internet access. Apps registered with a Syncfusion license key can be deployed on any system that does not have an internet connection.

I> Syncfusion license keys can be validated during the Continuous Integration (CI) processes to ensure proper licensing and prevent licensing errors during deployment. Refer to the [CI License Validation] (https://help.syncfusion.com/wpf/licensing/licensing-faq/ci-license-validation) section for detailed instructions on how to implement it.
I> Syncfusion license keys can be validated during the Continuous Integration (CI) processes to ensure proper licensing and prevent licensing errors during deployment. Refer to the [CI License Validation](https://help.syncfusion.com/wpf/licensing/licensing-faq/ci-license-validation) section for detailed instructions on how to implement it.

### WPF

Expand Down
38 changes: 24 additions & 14 deletions wpf/Licensing/licensing-faq/CI-license-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,17 @@ The following section shows how to validate the Syncfusion license key in CI ser

* Download and extract the LicenseKeyValidator.zip utility from the following link: [LicenseKeyValidator](https://s3.amazonaws.com/files2.syncfusion.com/Installs/LicenseKeyValidation/LicenseKeyValidator.zip).

* Open the LicenseKeyValidation.ps1 PowerShell script in a text\code editor.
* Open the LicenseKeyValidation.ps1 PowerShell script in a text\code editor as shown in the below example.

{% tabs %}
{% highlight c# tabtitle="PowerShell" %}
# Replace the parameters with the desired platform, version, and actual license key.

$result = & $PSScriptRoot"\LicenseKeyValidatorConsole.exe" /platform:"WPF" /version:"26.2.4" /licensekey:"Your License Key"

Write-Host $result
{% endhighlight %}
{% endtabs %}

![LicenseKeyValidation script](licensing-images/license-validation.png)

Expand All @@ -41,14 +51,14 @@ The following section shows how to validate the Syncfusion license key in CI ser

## Azure Pipelines (YAML)

* Create a new [User-defined Variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#user-defined-variables) named `LICENSE_VALIDATION` in Azure Pipeline. Use the path of the LicenseKeyValidation.ps1 script file as a value (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1).
* Create a new [User-defined Variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#user-defined-variables) named `LICENSE_VALIDATION` in the Azure Pipeline. Use the path of the LicenseKeyValidation.ps1 script file as a value (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1).

* Integrate the PowerShell task in pipeline and execute the script to validate the license key.
* Integrate the PowerShell task in the pipeline and execute the script to validate the license key.

The following example shows the syntax for Windows build agents.

{% tabs %}
{% highlight c# tabtitle ="YAML" %}
{% highlight c# tabtitle="YAML" %}
pool:
vmImage: 'windows-latest'

Expand All @@ -65,20 +75,20 @@ steps:

## Azure Pipelines (Classic)

* Create a new [User-defined Variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#user-defined-variables) named `LICENSE_VALIDATION` in Azure Pipeline. Use the path of the LicenseKeyValidation.ps1 script file as a value (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1).
* Create a new [User-defined Variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#user-defined-variables) named `LICENSE_VALIDATION` in the Azure Pipeline. Use the path of the LicenseKeyValidation.ps1 script file as a value (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1).

* Include the PowerShell task in pipeline and execute the script to validate the license key.
* Include the PowerShell task in the pipeline and execute the script to validate the license key.

![LicenseKeyValidation script](licensing-images/license-validation-classic.png)

## GitHub actions

* To execute the script in PowerShell as part of a GitHub Actions workflow, include a step in the configuration file and update the path of the LicenseKeyValidation.ps1 script file (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1).

The following example shows the syntax for validating Syncfusion license key in GitHub actions.
The following example shows the syntax for validating the Syncfusion license key in GitHub actions.

{% tabs %}
{% highlight c# tabtitle ="YAML" %}
{% highlight c# tabtitle="YAML" %}
steps:
- name: Syncfusion License Validation
shell: pwsh
Expand All @@ -89,11 +99,11 @@ The following example shows the syntax for validating Syncfusion license key in

## Jenkins

* Create a [Environment Variable](https://www.jenkins.io/doc/pipeline/tour/environment) named 'LICENSE_VALIDATION'. Use Use the path of the LicenseKeyValidation.ps1 script file as a value (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1).
* Create an [Environment Variable](https://www.jenkins.io/doc/pipeline/tour/environment) named 'LICENSE_VALIDATION'. Use the path of the LicenseKeyValidation.ps1 script file as a value (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1).

* Include a stage in Jenkins to execute the LicenseKeyValidation.ps1 script in PowerShell.

The following example shows the syntax for validating Syncfusion license key in Jenkins pipeline.
The following example shows the syntax for validating the Syncfusion license key in the Jenkins pipeline.

{% tabs %}
{% highlight json %}
Expand All @@ -113,11 +123,11 @@ pipeline {
{% endhighlight %}
{% endtabs %}

## Validate the License Key Using ValidateLicense() Method
## Validate the License Key By Using the ValidateLicense() Method

* Register the license key properly by calling RegisterLicense("License Key") method with the license key.

* Once the license key is registered, it can be validated by using ValidateLicense("Platform.WPF") method. This ensures that the license key is valid for the platform and version you are using. For reference please check the following example.
* Once the license key is registered, it can be validated by using the ValidateLicense("Platform.WPF") method. This ensures that the license key is valid for the platform and version you are using. For reference, please check the following example.

{% tabs %}
{% highlight c# %}
Expand All @@ -133,7 +143,7 @@ bool isValid = SyncfusionLicenseProvider.ValidateLicense(Platform.WPF);

![LicenseKeyValidationMethod](licensing-images/license-validation-method.png)

* If ValidateLicense() method returns true, registered license key is valid and can proceed with deployment.
* If the ValidateLicense() method returns true, registered license key is valid and can proceed with deployment.

* If ValidateLicense() method returns false, there will be invalid license errors in deployment due to either an invalid license key or an incorrect assembly or package version that is referenced in the project. Please ensure that all the referenced Syncfusion assemblies or NuGet packages are all on the same version as the license key’s version before deployment.
* If the ValidateLicense() method returns false, there will be invalid license errors in deployment due to either an invalid license key or an incorrect assembly or package version that is referenced in the project. Please ensure that all the referenced Syncfusion assemblies or NuGet packages are all on the same version as the license key’s version before deployment.