Off-line activation

Aug 3, 2011 at 6:45 PM

Is possible to perform the activation procedure disconnected from the Internet?

Coordinator
Aug 5, 2011 at 12:56 AM

Well, it is possible to make an activation disconnected though it may require a manual process.

This process could be something like this:

1. Include in you application an utility that will write the machine hash into a text file in a readable format.
2. Ask your customer to send that file to you (maybe by email from another computer or by phone, spelling the words in the text file)
3. Create the license file in your computer from the machine hash
4. Send the license file to your customer or spell the words by phone to your customer

As you can see, this can have many variations depending on the customer isolation. The worst case is when the customer don't have access to email and everything needs to be performed by phone.

In any case, you need to implement this functionality in your product. As a help, this could be the source code of a program to generate the machine hash from the customer's computer.

Hope this is info is useful.

 

using System;
using System.IO;

using Activatar;

    class Program
    {
        static void Main(string[] args)
        {
            IMachineIdentifierProvider identifierProvider = new MachineIdentifierProvider(
                new IMachineIdentifier[] { new MachineNameIdentifier(), new NetworkAdapterIdentifier(), new VolumeInfoIdentifier() });
            byte[] machineHash = identifierProvider.MachineHash;
            string hash = Convert.ToBase64String(machineHash);

            using (StreamWriter writer = new StreamWriter("MachineHash.txt"))
            {
                writer.WriteLine(hash);
            }
        }
    }

Aug 5, 2011 at 11:36 PM

I did not expect this response so quickly.

Thank you very much. I'll check this procedure and return with the results.

Oct 30, 2013 at 12:10 PM
I would like to use the Solution to Generate License File and send to the customer via email.
but when I use the unit test as good example, I am getting the following error:
        string privatekey = GetPrivateKey();
        // Genetarate the Product Key >>> it is working fine.
        ProductKeyPublisher keyPublisher = new ProductKeyPublisher(privatekey);
        string productKey1 = keyPublisher.GenerateProductKey(100, 200, 30);
        Console.WriteLine(productKey1);

        //Validate the Product key and the Trial Period >>>> it is validate fine
        ProductKeyInfo result = keyPublisher.ValidateProductKey(productKey1);
        Console.WriteLine(result.ProductID);

        // Generate the License information
        string publicXmlKey = GetPrivateKey();
        ProductLicenseManager licenseManager = new ProductLicenseManager(publicXmlKey);
        ProductLicense license = licenseManager.ActivateProduct(productKey1);
       Console.WriteLine(license.TrialDaysLeft); 
in the Generation of the License Information, will not work, because licenseManager.ActivateProduct is a method via interface IActivationService , and it can be only initialize via :
            ChannelFactory<IActivationService> factory = new ChannelFactory<IActivationService>("activationBinding");
            IActivationService service = factory.CreateChannel();
            ProductLicenseInfo licenseInfo = service.ActivateProduct(productKey, Convert.ToBase64String(_identifierService.MachineHash)); 
now since there will be any web service to use this interface the license always empty and have status of internal error.

how we can modify the code to use this interface without the web service? can we modify this in the activationBinding.