Class LocalStoreConfigurationExtensions
Provides extension methods for IAgentCommenceConfigurationPhase relevant to Machine Locked licensed applications with licenses being stored on the associated machine.
Namespace: Sp.Agent.Configuration
Assembly: Sp.Agent.Local.dll
Methods
WithApplicationInitializedStore(IAgentCommenceConfigurationPhase, String, Action<DirectoryInfo>)
Configures the Software Potential Agent to maintain its licenses on a machine locked basis in a specified folder with an Action
used to initialize the directory when directed to via via IInitializeStores under the control of an Installer.
This configuration is typically used when one is managing the store initialization via an installation process that will call into the Application and/or implement a Managed Installer class (i.e. if you will use installutil.exe
against the application/plugin's Assembly or a Installer that has an option to invoke Managed Installers.
Declaration
public static IAgentHardwareBoundStorageConfigurationPhase WithApplicationInitializedStore(this IAgentCommenceConfigurationPhase that, string rootPath, Action<DirectoryInfo> initialize)
Parameters
Type | Name | Description |
---|---|---|
IAgentCommenceConfigurationPhase | that | Starting point of Sp.Agent configuration pipeline. |
System.String | rootPath | License store root directory. Should be application specific. |
System.Action<System.IO.DirectoryInfo> | initialize |
|
Returns
Type | Description |
---|---|
IAgentHardwareBoundStorageConfigurationPhase | A reference to the next phase of the configuration pipeline. |
WithExternallyInitializedStore(IAgentCommenceConfigurationPhase, String)
Configures the Software Potential Agent to maintain its licenses on a machine locked basis in an externally provisioned Directory such as %ProgramData%\Your Application\Version
. The application will require an external installer to provision the directory correctly prior to any attempts to Activate a License etc.
For example, one might use this configuration where you have a WiX-based installer that will create a folder under C:\ProgramData
for your application and modify the folders permissions to be shared across the All Users Group.
Declaration
public static IAgentHardwareBoundStorageConfigurationPhase WithExternallyInitializedStore(this IAgentCommenceConfigurationPhase that, string rootPath)
Parameters
Type | Name | Description |
---|---|---|
IAgentCommenceConfigurationPhase | that | Starting point of Sp.Agent configuration pipeline. |
System.String | rootPath | License store root directory. Subdirectories will be maintained within this area by the Store. The caller is responsible for ensuring that the
|
Returns
Type | Description |
---|---|
IAgentHardwareBoundStorageConfigurationPhase | A reference to the next phase of the configuration pipeline. |
Remarks
The store will generate a folder underneath the designated rootPath
with a GUID-based name specific to the Product and Version of the Licenses being stored. Hence one could theoretically use the same base path for all your applications. It is recommended NOT to do this as having the licenses in a folder path that includes the application name and version can simplify manual diagnosis of licensing issues.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown if |
WithLocalSharedStore(IAgentCommenceConfigurationPhase, String)
Please refer to WithExternallyInitializedStore
which has identical functionality. This deprecated method will be removed in the future.
Declaration
[Obsolete("Please use WithExternallyInitializedStore or select an alternate store configuration")]
public static IAgentHardwareBoundStorageConfigurationPhase WithLocalSharedStore(this IAgentCommenceConfigurationPhase that, string licenseStoreRootPath)
Parameters
Type | Name | Description |
---|---|---|
IAgentCommenceConfigurationPhase | that | |
System.String | licenseStoreRootPath |
Returns
Type | Description |
---|---|
IAgentHardwareBoundStorageConfigurationPhase |
WithSingleUserStore(IAgentCommenceConfigurationPhase, String, String)
Configures the Software Potential Agent to maintain its licenses on a machine locked basis in an externally provisioned rootPath
. Typically this will apply when you choose (or are restricted to) store data in an area provided implicitly by the OS / hosting environment that is not application specific such as %LOCALAPPDATA%
.
This is appropriate when an application will be installed/accessible on a 'Just for Me' basis in the User's User Profile Folder (as opposed to in a folder shared across User Profiles, which requires an Administrator/elevated installation process to grant appropriate sharing rights required in that instance).
For example, one might employ such a storage mechanism in a ClickOnce-delivered application.
Declaration
public static IAgentHardwareBoundStorageConfigurationPhase WithSingleUserStore(this IAgentCommenceConfigurationPhase that, string rootPath, string applicationSubfolder)
Parameters
Type | Name | Description |
---|---|---|
IAgentCommenceConfigurationPhase | that | Starting point of Sp.Agent configuration pipeline. |
System.String | rootPath | License store root directory. Subdirectories will be maintained within this area by the Store. The caller is responsible for ensuring that the Directory exists and is correctly permissioned such that the licensing system will be able to access the directory at runtime. The location must exist prior activating or consuming any licenses.
|
System.String | applicationSubfolder | Application-specific subfolder portion within The
|
Returns
Type | Description |
---|---|
IAgentHardwareBoundStorageConfigurationPhase | A reference to the next phase of the configuration pipeline. |
Remarks
As with WithExternallyInitializedStore(IAgentCommenceConfigurationPhase, String), every combination of Software Potential product sharing a given rootPath
will have an isolated store subdirectory within which that set of licenses are maintained. The function of the mandatory applicationSubfolder
is to ensure the base path does not get polluted with lots of folders bearing names derived from GUIDs.