I mean that my software must be run for only 7 days when it is installed on any system. It is possible with registry but i dont know how it is possible.
Asked
Active
Viewed 984 times
0
-
there are commercial frameworks for this... Failing that on startup check the date! (easily defeated of course) – Mitch Wheat Aug 16 '11 at 08:15
1 Answers
3
Pseudo-code:
if myRegistryKey exists:
dayOfFirstRun = read(myRegistryKey)
if today > dayOfFirstRun + 7 days:
-- Trial Version Expired --
else
-- ((dayOfFirstRun + 7 days) - today) Days Left --
else
write(myRegistryKey, today)
That should be enough to get you started. Obviously, this simple method can be circumvented quite easily. For more advanced algorithms, have a look at the following related questions (and countless others on StackOverflow):