In my desktop program, I want to check that to see if the user has set his clock back.
To do so, I compare the timestamp of certain Operating System files to the current computer date. If any are after what the computer thinks is the current date, then he must have set his clock back.
For Windows XP, I have been using such files as:
c:win386.swp
c:windowsuser.dat
and several others.
Two questions:
Is this a decent way to do this, or is there something better?
(Assuming the answer to 1 is "decent") What would be some good Windows Vista and Windows 7 files to compare with?
Conclusion: Priyank said something obvious that had eluded me: Rather than using any system files, the easiest and simplest way might be to just use the timestamp of your program itself. After all, the date it was installed is exactly the date you want your trial to start from.
As it turns out, your answers and my research of other related StackOverflow questions and mentioned articles has led me to decide on a much simpler scheme. My trial users already have to get a key to use the trial. I ve got the date registered embedded into the key. I really don t have to check for setting the clock back. Instead I can just seee if the current time is between the date registered and the date registered plus n days.
If they want to go to the trouble of getting around that scheme, then let them. I agree that those people wouldn t pay anyway. Make your program something worthwhile that people enjoy and want to use and most will pay.