View previous topic :: View next topic |
Author |
Message |
darjonase Guest
|
Posted: Fri Jun 16, 2006 7:02 pm Post subject: Asked for serial key every time application installed... |
|
|
When I create a new build of my software and the user installs in on their PC, they are prompted to enter the serial key again, even if they have already entered a valid key.
I have not changed anything in the code related to the key. Why is this happening, and can I change it?
Thanks,
Darian Bonnell
LMI Corporation |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Fri Jun 16, 2006 11:41 pm Post subject: |
|
|
Are you licensing an application or components/controls?
Are you obfuscating your code?
One reason I have seen for this in the past is that in older versions of ILS the default name of the license file for applications was based on the name of the class being licensed. Thus if you used an obfuscator that changed the name of the class the name of the license file would change. The fix for this was to tell the obfuscator not to change the name of this class. The latest version of ILS allows you to easily specify the file name explicitly when reading and installing license thus avoiding the problem altogether. See the latest Licensed Application sample project for an example. _________________ Infralution Support |
|
Back to top |
|
|
Guest
|
Posted: Mon Jun 19, 2006 12:01 pm Post subject: |
|
|
My code is the same as in the example...
My Code......
Code: |
Private Sub CheckLicensing()
' create the license provider used to get/install the license
Dim sProvider As New EncryptedLicenseProvider
Dim sLicense As EncryptedLicense = sProvider.GetLicense(LICENSE_PARAMETERS, LICENSE_FILE)
' check if there is a valid license for the application
If sLicense Is Nothing Then
' if there is no valid license then display the standard license install form
' to allow the user to enter a license key
Dim licenseForm As New LicenseInstallForm
sLicense = licenseForm.ShowDialog("Universal Gage Interface", "www.lmicorporation.com", LICENSE_FILE)
End If
' if there is still no license check for evaluation mode
If sLicense Is Nothing Then
' use the EvaluationMonitor class to check whether the evaluation has expired
Dim monitor As New EvaluationMonitor("UniversalGageInterface")
If monitor.DaysInUse > 30 Or monitor.Invalid Then
MessageBox.Show("Your evaluation has expired")
Application.Exit()
Else
MessageBox.Show(String.Format("You are on day {0} of your 30 day evaluation", monitor.DaysInUse))
End If
End If
End Sub
|
Your Code.....
Code: |
Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
' create the license provider used to get/install the license
'
Dim sProvider As New EncryptedLicenseProvider
Dim sLicense As EncryptedLicense = sProvider.GetLicense(LICENSE_PARAMETERS, LICENSE_FILE)
' check if there is a valid license for the application
'
If sLicense Is Nothing Then
' if there is no valid license then display the standard license install form
' to allow the user to enter a license key
'
Dim licenseForm As New LicenseInstallForm
sLicense = licenseForm.ShowDialog("MyApp", "www.mycompany.com", LICENSE_FILE)
End If
' if there is still no license check for evaluation mode
'
If sLicense Is Nothing Then
' use the EvaluationMonitor class to check whether the evaluation has expired
'
Dim monitor As New EvaluationMonitor("MyProductSecretName")
If monitor.DaysInUse > 30 Or monitor.Invalid Then
MessageBox.Show("Your evaluation has expired")
Application.Exit()
Else
MessageBox.Show(String.Format("You are on day {0} of your 30 day evaluation", monitor.DaysInUse))
End If
Else
_v1TextBox.Enabled = True
' enable the v2 text box only if the product info for the license
' contains the required text
'
If sLicense.ProductInfo = "2.0" Then
_v2TextBox.Enabled = True
End If
End If
End Sub
|
What am I doing wrong? |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Mon Jun 19, 2006 11:30 pm Post subject: |
|
|
Your licensing code looks OK. Can you provide some more information about the problem.
Are you able to replicate the issue on your development/test machines? If so does the license get requested again each time you compile and run?
Are you changing LICENSE_PARAMETERS or LICENSE_FILE constant strings between builds?
Does your LICENSE_FILE string include a directory path?
Can you verify that the license file is in fact create in the expected place?
Are you using an obfuscator - try doing a build without this and see if this makes any difference. _________________ Infralution Support |
|
Back to top |
|
|
|