SDKs
...
Tutorials
Best Practices

Handling Product Versions

8min

Product versioning empowers vendors to introduce fresh iterations of their licensed products, fostering increased customization.

This article serves to educate readers on a range of topics, including defining and retrieving application versions, implementing conditional update checks within maintenance windows, validating product versions during license checks, and other relevant insights.

Prerequisites

  1. Completed the Getting Started tutorials, specifically:
    • Initialized LicenseManager (or LicenseHandler) with your configuration using the appropriate settings.
    • Activated a license.

Defining App Version

Setting application version is completed within the Configuration constructor, as shown below:

C++
C#
Java
Swift
Python


The fifth parameter passed, appVersion, is where the version is set for the application.

From here, current app version can be accessed with:

C++
C#
Java
Swift


To access a list of all available product versions, we can use getVersionList() from the LicenseManager object. Acquiring a vector of strings containing all versions is done with:

C++
C#
Java
Swift
Python


Retrieving Installation Files

Getting Latest Installation File During Online License Check

To confirm the latest product version during a license check, we'll construct an InstallationFile object and assign it the value obtained from license->check().

As license->check() furnishes the most recent InstallationFile associated with the license, we can subsequently access the version information by executing:

C++
C#
Swift


Getting All Installation Files

Developers can also retrieve the latest InstallationFile releases through the LicenseManager object through use of the licenseID as follows:

C++
C#
Java
Swift
Python


Note:

The C++ getInstallationFile() method has two additional, optional parameters. The second parameter is to declare a desired product version, if not provided then the last available version will be assumed. The third parameter is a InstallFileFilter object that can be used to filter install files by environment and channel.

The .NET SDK has one additional parameter, an InstallationFileOptions object that can be used to filter install files by channel or environment, as well as the needed version.

Exceptions called if an installation file is not found for requested app version:

C++: ProductVersionException

.NET: AppVersionNotFoundException

Java: LicenseSpringException

InstallationFile Class Overview and Intermediate Updates

The InstallationFile class holds crucial information about a product's installation file.

It captures details about the product installer or setup file uploaded via the LicenseSpring platform or Management API, facilitating efficient product versioning and management.

Installation files can be used to regulate intermediate updates through accessing the required app version to complete the update

An intermediate update denotes an update that mandates a specific version of the predictor to be presently installed.

You can verify the necessary version by utilizing InstallationFile as follows:

C++
C#
Swift