Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > how to license managing VB.NET
 

how to license managing VB.NET

I have a vb.net windows application setup project build in vs2005i have done the core functionalities in the project,my task is i want 2 maintain a license for this product

Example,If a client has bought 10 license of this product,then this product should be installed in only 10 machines ,if the 11th machine is installed any error message displaying "license not available" should be displayed. any body pls tell me how to do this.

thanls sjpk
Jeyanth.s  Wednesday, September 16, 2009 5:01 AM

Hi Jeyanth.s,

Based on my understanding, the main issue is how to create a license file for a machine and make sure this license can only be used on this machine. I have one idea to do this, you can follow the steps below to create a license:

How to create a license:

1. Get some information about one machine which can be used to identify this machine. For example, we can use the Mac address.

2. Use the machine information to generate the license data.

3. Use some encrypt algorithm to encrypt the license data and save the encrypt data to a license file.

4. Sell this license file to the customer.

How to check a license:

1. Create a library and add a custom Installer class.

2. Override the Install method and check whether a license file is located on this machine.

3. Load the data from the license file and decrypt data.

4. Get the machine information from the decrypt data.

5. Get the machine information of this machine and compare it to the information got from the decrypt data.

6. If the information is in accordance, continue the setup process. Otherwise, roll back.

The thread below shows how to get the Mac address with C#:
http://social.msdn.microsoft.com/Forums/en-US/netfxnetcom/thread/1344dad4-dffe-486c-bf30-1b75d21fc9ba.

You can follow this link to convert code from C# to VB.Net:
http://www.developerfusion.com/tools/convert/csharp-to-vb/.

The document below is about RSA Private Key Encryption:
http://www.codeproject.com/KB/security/PrivateEncryption.aspx.

We can use the private key to encrypt the license data when we create a license file and use the public key to decrypt in the custom action.

This is a walkthrough about create a custom action:
http://msdn.microsoft.com/en-us/library/d9k65z2d(VS.80).aspx.

Let me know if this does not help.
Aland Li


Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
Aland Li  Thursday, September 17, 2009 10:06 AM

Hi Jeyanth.s,

Based on my understanding, the main issue is how to create a license file for a machine and make sure this license can only be used on this machine. I have one idea to do this, you can follow the steps below to create a license:

How to create a license:

1. Get some information about one machine which can be used to identify this machine. For example, we can use the Mac address.

2. Use the machine information to generate the license data.

3. Use some encrypt algorithm to encrypt the license data and save the encrypt data to a license file.

4. Sell this license file to the customer.

How to check a license:

1. Create a library and add a custom Installer class.

2. Override the Install method and check whether a license file is located on this machine.

3. Load the data from the license file and decrypt data.

4. Get the machine information from the decrypt data.

5. Get the machine information of this machine and compare it to the information got from the decrypt data.

6. If the information is in accordance, continue the setup process. Otherwise, roll back.

The thread below shows how to get the Mac address with C#:
http://social.msdn.microsoft.com/Forums/en-US/netfxnetcom/thread/1344dad4-dffe-486c-bf30-1b75d21fc9ba.

You can follow this link to convert code from C# to VB.Net:
http://www.developerfusion.com/tools/convert/csharp-to-vb/.

The document below is about RSA Private Key Encryption:
http://www.codeproject.com/KB/security/PrivateEncryption.aspx.

We can use the private key to encrypt the license data when we create a license file and use the public key to decrypt in the custom action.

This is a walkthrough about create a custom action:
http://msdn.microsoft.com/en-us/library/d9k65z2d(VS.80).aspx.

Let me know if this does not help.
Aland Li


Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
Aland Li  Thursday, September 17, 2009 10:06 AM

You can use google to search for other answers

Custom Search

More Threads

• Reference in the deployment does not match the identity defined in the application manifest.
• Deplyoment of the same XBAP from different origins to a single client
• Disable clickonce user prompt
• Applications are not available offline - ClickOnce deployment.
• Questions regarding "Deployment projects"?
• Why VS7 does not take updated environment variable?
• Windows installer and self updates
• MSBUILD ERROR MSB3147
• Custom Action Fails with not enough permissions VS.net 2008 Setup
• Packaging ActiveX in CAB using C#