View previous topic :: View next topic |
Author |
Message |
johnd
Joined: 11 Jun 2005 Posts: 3 Location: Cambridge UK
|
Posted: Fri Nov 03, 2006 11:31 am Post subject: Licence file location |
|
|
I've been lazy and looking back at an app coded a few months back, I don't seem to have explicitly set a location for the ILS licence file at all. Presumably ILS just gives the licence a default name (ProgramName.CheckLicence.lic) and location (the program's installation folder) under these circumstances?
With Vista release imminent and the associated problems that might bring with User Access Control, I think I should set the licence location explicitly. So I think I need to add a declaration to my ILS-using class (VB2005):
Const LICENSE_FILE as string = System.Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) & "MyApp.lic"
('CommonApplicationData' so that all users can see the licence file. There'll typically only be one user, but just to be sure...)
Could you confirm/comment on whether this seems OK please? |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Fri Nov 03, 2006 9:43 pm Post subject: |
|
|
Yes that is the right approach. You could also consider creating a folder with your company name/product under the common data directory so that if you end up storing more data there you don't litter the root directory with lots of files. _________________ Infralution Support |
|
Back to top |
|
|
johnd
Joined: 11 Jun 2005 Posts: 3 Location: Cambridge UK
|
Posted: Sun Nov 05, 2006 1:29 pm Post subject: |
|
|
Hmm, this doesn't seem to work in practice because of an assignment problem. Trying to assign the LICENSE_FILE constant as above gives me a 'constant expression required' error, presumably because .Net doesn't consider the System.Environment.etc values as constant, which I guess in one important sense they're not even though the value will be constant for any given user or Windows installation.
For this approach to work it would seem that license_file needs to be a string variable and not a constant. Perhaps the example code for ILS could be updated to reflect this - this issue (ie where the license file is stored) is presumably going to become more important in future under Vista. |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Sun Nov 05, 2006 9:59 pm Post subject: |
|
|
Sorry - I should have looked more carefully. You indeed cannot use a constant. We will consider changing the sample project to illustrate storing the data in the common application data directory as above. _________________ Infralution Support |
|
Back to top |
|
|
|