Esempio n. 1
0
            public static bool ProcessInstallationArgs(string[] args)
            {
                var handledSomething = false;

                // Check if the installer is trying to get us to initialize the store
                // Only strictly needed for MultiUser scenario
                if (CommandLineParsing.HasSwitch("initialize", args))
                {
                    ExecuteCommandLineAction(
                        "Initializing Shared License Storage...",
                        SpAgent.Configuration.StoresInitialization.Initialize);
                    handledSomething = true;
                }

                // Verify the assumption that the installer has done its work by having the Agent Verify each of its registered stores
                // NB do not remove this line as it is responsible for ensuring the correct timely Configuration of the Licensing System.
                ReportInstallationActionIfDebug("Verifying Storage...");
                SpAgent.Configuration.VerifyStoresInitialized();
                ReportInstallationActionIfDebug("... verified.");

                // Check if the installer is trying to get us to activate a license
                var activationKey = CommandLineParsing.ArgumentOrDefault("activate", args);

                if (activationKey != null)
                {
                    ExecuteCommandLineAction(
                        "Activating License: " + activationKey,
                        () => SpAgent.Product.Activation.OnlineActivate(activationKey));
                    handledSomething = true;
                }

                return(handledSomething);
            }
Esempio n. 2
0
            public static bool ProcessUninitializationArgs(string[] args)
            {
                if (CommandLineParsing.HasSwitch("uninitialize", args))
                {
                    ExecuteCommandLineAction(
                        "Removing Shared License Storage...",
                        SpAgent.Configuration.StoresInitialization.Uninitialize);
                    return(true);
                }

                return(false);
            }