SLP Runtime License Store
This article does not apply to the SpAgent runtime that is replacing the older Microsoft.Licensing runtime as SpAgent license store is not registry based.
Registry-based License Stores on a Machine
The license store uses the following registry keys depending on the machine OS:
- 32 bit editions of Windows:
HKEY_LOCAL_MACHINE\Software\Microsoft\SLP Services - 64 bit editions of Windows:
HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\SLP Services
Registry-based License Store for Distributor
In the case of Distributor the license store uses the following registry keys depending on the machine OS:
- 32 bit editions of Windows:
HKEY_LOCAL_MACHINE\Software\InishTech\SLP Services - 64 bit editions of Windows:
HKEY_LOCAL_MACHINE\Software\Wow6432Node\InishTech\SLP Services
As and from V3.2.1987 Distributor server has an “-obliterate” option that deletes the license store while uninstalling Distributor. It is the recommend approach to the removal of the Distributor license store.
License Store Re-installation
It may be necessary to reinstall the license store e.g. if the store has become corrupted or has been tampered with. To reinstall the store it must be first deleted and this deletion will also delete all installed licenses in the store.
License Re-activation
Re-installation of the license store generates new DeviceID which means all previously installed licenses on that machine must be reactivated. If the license is a Single Machine locked license (i.e. it can only be reactivated on the device on which it was initially activated) either:
- The current license will have to be deactivated or
- A new replacement license will have to be issued in place of the current license.
Reinstall Local Machine Store
Option 1: Use Slps.Runtime.Configuration.exe to delete/reinstall license store< /h4>
This involves copying some DLLs to the customer machine and then using the Slps.Runtime.Configuration.exe to delete and then reinstall the license store:
- Copy ALL the following DLLs to a folder on the target machine:
- Slps.Runtime.Configuration.exe (from Code Protector installation folder)
- Slps.Runtime.Installer.dll (from Code Protectpr installation folder)< /li>
- Microsoft.Licensing.Utils2.0.DLL
- Microsoft.Licensing.Runtime2.0.DLL
- Your custom Microsoft.Licensing.Permutation_123XX_2.0.dll".
- From an elevated command prompt:
- First run
Slps.Runtime.Configuration -Obliterate
- Then run
Slps.Runtime.Configuration /Install
- First run
One could further simplify the process and reduce possibility of error by creating a small batch or command file that would do the deletion and re-installation steps sequentially.
Option 2: Delete the Registry Key manually and reinstall the application
This option involves manual deletion of the appropriate Registry key using REGEDIT, followed by the re-installation of the application to trigger the re-installation of the license store:
- Delete the appropriate registry key using Regedit.exe or a PowerShell script.
- Once the key has been deleted reinstall your application which should trigger the reinstallation/configuration of the license stores.
This approach has the benefit of not needing any DLLs to be copied to the customer machine. However, use of Regedit is probably more suited to being done by a technical resources, as it involves manually finding and deleting a registry key. Requiring the reinstallation of the application in order to trigger the new store reinstallation may not be always feasible depending on the type of application and the reinstallation overhead.
Option 3: Delete the Registry key manually and reinstall using a custom installer class
If you have implemented the custom installer class in your application you could also use a
PowerShell script to:
- Delete the required key directly and then
- Trigger a re-installation of the license store via the custom installer by calling installutil.exe on your assembly e.g. by calling
%windir%\Microsoft.NET\Framework\v2.0.50727\installutil.exe<your assembly containing the Installer class>.<dll/exe>
While this option doesn’t require any DLLs to be copied, it does depend on the custom installer class to be present in your application.
Sample Powershell script to delete license store in registry (reinstall via one of the above methods):
# Delete Registry Keys for Software Potential Local License/Usage Stores' %{ if([IntPtr]::Size -eq 4){ Write-Host "32 bit operating system" $StoresLocation = "HKEY_LOCAL_MACHINE\Software\Microsoft\SLP Services" } Else{ Write-Host "64 bit operating system" $StoresLocation = "HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\SLP Services" } if(Test-Path $StoresLocation){ if(get-confirmation){ Write-Output "Removing $StoresLocation" Remove-Item $StoresLocation -Recurse -Force Write-Output "Removed $StoresLocation" Write-Output "Reinstall $StoresLocation" %windir%\Microsoft.NET\Framework\v2.0.50727\installutil.exe .<dll/exe> Write-Output "Installed $StoresLocation" } } Else{ Write-Host "Distributor Store doesn't exist" } } function get-confirmation{ $caption = "Confirm Reinstallation Action"; $message = "Do you want to reinstall the Local License Store in Registry?"; $yes = new-Object System.Management.Automation.Host.ChoiceDescription "&Yes","Yes"; $no = new-Object System.Management.Automation.Host.ChoiceDescription "&No","No"; $choices = [System.Management.Automation.Host.ChoiceDescription[]]($yes,$no); $answer = $host.ui.PromptForChoice($caption,$message,$choices,0) switch ($answer){ 0 {return $true} 1 {return $false} } }
Reinstall Distributor License Store
As and from V3.2.1987 Distributor server has an “-obliterate” option that deletes the license store while uninstalling Distributor. The install.cmd utility is in \Slps.Distributor\Host folder in the Distributor installation directorty.
To reinstall the Distributor license store, from an elevated command prompt,
- Delete the store by running
install.cmd -obliterate
- Reinstall the store by running
install.cmd -install
Comments
0 comments
Article is closed for comments.