You could also throw one more curveball. Create a "app.pref" file in an
obvious place, and drop the creation date in there. If the "real" ini
is present, and the dummy file is not, throw an alert along the lines
of: "Internal error - please contact the author with code 0604". If the
date in the dummy doesn't match the date in the real ini, throw an
alert "Internal error - please contact the author with code 0801" (just
to see if you can catch somebody being naughty, and dumb enough to
contact you). A message with the first code be somebody who wiped the
file accidentally. A message with the second code means they actively
attempted to circumvent the expiration.
There are several ways of doing it. But none are completely fool proof
Generally I stick away from online stuff, as in my case I cannot be
sure
the user will have a connection.
My method relies heavily on the use of buddiapi - but there are other
ways to achieve the same result.
Using buddyapi, on install I create an ini file with 3 keys
installDate
lastKnownDate
numberOfTimeUsed
In real terms, I actually call these something like a1,a2 and a3 so its
not so obvious.
Usually, my applications have a file structure with them so it's pretty
easy to hide the ini, also, its worth noting that with buddy, the file
does not need to be named .ini - you can name it something else
entirely.
Obviously this would be easy to change, so before I write\read these
strings from the ini, I encrypt\decrypt them accordingly using buddy's
encryption functions.
Obviously you enter the install date when you install the program on
the
machine, I make sure that there is only a suitable window in which it
can be set. So if I know that a new version will be released in 30
days
I only allow the date to be set between now and 30 days time.
Each time the program starts, it checks the installdate is less than x
number of days ago and that the currentDate is greater than the
installDate
It also checks the current date against the lastKnowndate to check the
clock has not been put back, if it hasn't, I update the last known
date,
and the number of times used (good if you want to limit the number of
times the program can be used.)
If you want, you could move the ini file to somewhere discreet on the
users file system, or put these same values in the registry, this makes
it harder for the users to actually uninstall \ reinstall the software.
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi To post messages to the list, email
lingo-l@penworks.com (Problems, email [EMAIL PROTECTED]). Lingo-L is for
learning and helping with programming Lingo. Thanks!]