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. Prices and more information can be found here We offer a substantial discount to universities and institutes with an academic focus.

Activation

  • A license key has the structure XXXXXXXX-XXXXXXXX-XXXXXXXX (8 digits - 8 digits - 8 digits)
  • Licenses can be activated using the menu "Tools" -> "Version manager" -> menu "Licenses".
  • Read further details about versioning in the article about the Version manager.
  • Each license key can come with multiple setup activations. So the the same license key can be used at multiple setups in case you purchases multiple setup activations.
  • 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 activatated setups does not overcome the number of purchased setup activations for the particular license key.
  • During the deactivation, all Add-on modules will be removed that had been activated with the license.

Offline Activation / CLI Activation

Requires SweepMe! version >= 1.5.7.3

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 a 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
$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

##########################################
# 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.