0

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.

Dot NET
  • 4,891
  • 13
  • 55
  • 98
Girish
  • 19
  • 1
  • 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 Answers1

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):

Community
  • 1
  • 1
Heinzi
  • 167,459
  • 57
  • 363
  • 519