Licenses

From SweepMe! Wiki
Jump to navigation Jump to search

SweepMe! version >= 1.5.5

The free main software SweepMe! can be extended by a SweepMe! Pro subscription. What SweepMe! Pro adds, how the free SweepMe! Pro Trial works and what applies to lifetime licenses of SweepMe! 1.5 is described in SweepMe! Pro. Prices and more information can be found on our website. For universities and institutes with an academic focus, we offer SweepMe! Pro Academia at a reduced price.

Pro Modules can be downloaded and configured without a license (from version 1.5.7.2). The license is checked when a measurement is started.

Activation

  • A license key has the structure XXXXXXXX-XXXXXXXX-XXXXXXXX (three groups of 8 alphanumeric characters, separated by hyphens)
  • Licenses can be activated using the menu Tools → Version Manager → menu License → Activate key….
  • Read further details about versioning in the article about the Version manager.
  • Each license key can come with multiple setup activations. So the same license key can be used at multiple setups in case you purchased multiple setup activations.
  • Running several measurements at the same time, e.g. in two SweepMe! instances on the same computer, needs one setup activation per running measurement (checked from version 1.5.8.3). If you activate a key that is already activated on this computer, SweepMe! asks whether you want to assign an additional license to this computer.
  • Please press the button Refresh online versions at the top-right of the version manager to make sure all new contents are shown.

Deactivation

  • Licenses can be deactivated to use them on another computer, e.g. if a computer will be renewed. They can be activated again on the other machine as long as the number of currently activated setups does not exceed the number of purchased setup activations for the particular license key.
  • To deactivate, open the version manager → menu License → Overview and press Deactivate next to the license.

Afterwards you can activate the license on another computer again. Please note that you need an active internet connection.

Offline Activation / CLI Activation

Requires SweepMe! version >= 1.5.7.8

Overview

SweepMe! offers the possibility to activate a license using the command line interface (CLI Activation). This method allows for license management automation and can also be used for setups that do not have an internet connection (offline activation).

In general the CLI Activation consists of 3 steps:

  1. Generate an Activation Request (needs to be done on the computer with SweepMe! that shall be activated)
  2. Send the activation request to the sweep-me.net license server (needs to be done on a computer with internet access)
  3. Load the license into SweepMe! (needs to be done on the same computer as step 1)

CLI Activation / Refresh

The following PowerShell snippet can be used to activate SweepMe! via the command line. Adjust the variables according to your system and your requirements.

$ErrorActionPreference = 'Stop'

##########################################
# Set system specific variables
##########################################

# A name to be used for SweepMe! to identify the computer.
# Does not need to be identical to the Windows Computer Name, but it is
# recommended to specify a unique name that you can associate with the
# respective computer, especially if you have multiple licenses.
# You can use "$Env:ComputerName" if you want the current (windows) computer name.
$ComputerName = "My Computer"

# Use absolute Paths. Adjust the folder name to the installed SweepMe! version.
$SweepMePath = "C:\Program Files\SweepMe!\SweepMe!_1.5.7\SweepMe!.exe"
# A *.request file that will be created as part of the CLI activation
# If you want to activate multiple computers, it might be a good idea to include the 
# computer name in the filename (Only works if it does not have special characters that aren't allowed in filenames).
$ActivationRequestFile = Join-Path $([Environment]::GetFolderPath("MyDocuments")) "${ComputerName}_sweepme_activation.request"
# A *.license file that will be created as part of the CLI activation
$ActivationLicenseFile = Join-Path $([Environment]::GetFolderPath("MyDocuments")) "${ComputerName}_sweepme_activation.license"


##########################################
# Step 1: Create the activation request
##########################################
Write-Host "Step 1: Create the activation request"
Write-Host "-------------------------------------"

# Create activation request file. Use --force parameter to overwrite existing files.
$p = Start-Process -Wait -FilePath $SweepMePath -ArgumentList "--request-activation", "-o", "`"$ActivationRequestFile`"", "--force" -PassThru
if ($p.ExitCode -ne 0) { throw "Error creating activation request." }

##########################################
# For offline activation: Copy the *.request file to another computer with internet access.
##########################################

##########################################
# Step 2: Perform activation
##########################################
Write-Host "`nStep 2: Perform activation"
Write-Host "--------------------------"
$ActivationRequest = @{activationRequest = gc $ActivationRequestFile}

##########################################
# Step 2a (optional): Set a new computer name. You can remove this step to keep the current Computer Name.
##########################################
$ActivationRequest["withComputerName"] = $ComputerName

##########################################
# Step 2b (optional): Set the key for license activation. If this step is removed, a license refresh is performed instead.
##########################################
# $ActivationRequest["withLicenseKey"] = "12345678-12345678-12345678"

##########################################
# Step 2c: Send the activation request
##########################################
$ApiResult = Invoke-RestMethod -Method Post -Uri https://sweep-me.net/api/license/v2/activation -Body $ActivationRequest
if ($ApiResult.status -ne "SUCCESS") { throw $ApiResult.text }
Set-Content $ActivationLicenseFile $ApiResult.content

##########################################
# Step 2d (optional): If you want to activate an already activated license another time (e.g. for parallel measurements on the same computer)
#                     Run step 2c again afterwards.
##########################################
# $ActivationRequest["multiActivation"] = "1"

##########################################
# For offline activation: Copy the *.license file back to the computer where you started the activation request.
##########################################

##########################################
# Step 3: Load the license into SweepMe!
##########################################
Write-Host "`nStep 3: Load the license into SweepMe!"
Write-Host "--------------------------------------"

$p = Start-Process -Wait -FilePath $SweepMePath -ArgumentList "--load-license", "-i", "`"$ActivationLicenseFile`"" -PassThru
if ($p.ExitCode -ne 0) { throw "License import encountered issues." }

##########################################
# Optional: Check the activated licenses
##########################################
Write-Host "`nChecking license status"
Write-Host "-----------------------"

Start-Process -Wait -FilePath $SweepMePath -ArgumentList "--list-licenses"

Please note:

  • When running the script remotely, pay attention to use a computer name identifying the target (remote) machine that gets activated.
  • Uncomment Step 2b and enter your license key to perform a license activation. Leave this step out, and a license refresh will be performed instead.
  • When using this template for offline activation, steps 1 and 3 need to be run on the (same) computer that should be activated, and Step 2 needs to be done on a computer with internet access. Between the steps, you have to copy the generated *.request and *.license files.

CLI Deactivation

For backwards compatibility considerations with SweepMe! 1.5.6, a license deactivation via the command line is currently not possible. To deactivate a license on an offline Setup, you have to use following workaround:

  • Start SweepMe! normally and open the Version manager. In the License Overview, deactivate the respective license. SweepMe! will complain that there was an error when trying to deactivate the license because it could not connect to the internet, which can be ignored.
  • Now perform a CLI License Refresh as described above. This is necessary so that the license is available to be activated on another computer in the future.