AutoHotkey Community

It is currently May 27th, 2012, 6:58 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 49 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
PostPosted: March 7th, 2006, 12:25 am 
Hello. I would like to make at school a few small scripts that will have a time limit like a trial software. Do anyone know a script to do it?

regards,

stefan


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 7th, 2006, 1:52 am 
Offline

Joined: January 30th, 2006, 6:53 pm
Posts: 8
if youre looking for something that cannot be bypassed, i dont know...but you could do a simple read and write to a ini file placed somewhere. You could write each time the script is opened or take the amount of days (time) and go from there.

someone may have a better idea.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Expiry date
PostPosted: March 7th, 2006, 4:55 am 
Offline

Joined: December 20th, 2005, 4:15 am
Posts: 165
Location: Malaysia
What a coincidence. I just wrote something for this:

Code:
; ------------------
; Check For Expiry routine
; ------------------
CheckExpiry:
FormatTime, CurrentYear , YYYY, yyyy
FormatTime, CurrentMonth , MM, M
If (CurrentYear > 2006 Or CurrentMonth > 8)   ; valid till Sept 1.
   {
   MsgBox,, Beta version expired, `n Pls contact Lemming for new version. `n`n
   ExitApp
   }
Return

This just checks the current system date, and will Exit after Sept 1. You can call it with
Gosub, CheckExpiry

Note that users can just change the PC's date though.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 7th, 2006, 4:59 am 
Offline

Joined: November 26th, 2005, 10:35 pm
Posts: 196
Yeah, there's not much that you can do that's completely unbeatable. The closest to that is a "hidden" registry entry. You'd be surprised at how many users don't know about that method (or the registry at all, for that matter.) So, on first run, have the script add a registry entry to an inconspicuous registry location that tells what time it is, then on every other boot, have it read that entry and if a certain amount of time - days, months, whatever - has passed, have it give a MsgBox that it's expired and close.

What I find will enhance the security of this is making the script compare the dates between loads. If the date or time ever decreases (except for DST) then the script will invalidate itself early because accurate time tracking is impossible. Not foolproof, but better than nothing.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 7th, 2006, 5:29 am 
great idea but i get ERROR: TARGET LABEL DOES NOT EXIST.

i have use it on my scripts like that

CheckExpiry:
FormatTime, CurrentYear , YYYY, yyyy
FormatTime, CurrentMonth , MM, M
If (CurrentYear > 2006 Or CurrentMonth > 8) ; valid till Sept 1.
{
MsgBox,, Beta version expired, `n Pls contact Lemming for new version. `n`n
ExitApp
}
Return

and

Gosub, CheckExpiry:
FormatTime, CurrentYear , YYYY, yyyy
FormatTime, CurrentMonth , MM, M
If (CurrentYear > 2006 Or CurrentMonth > 8) ; valid till Sept 1.
{
MsgBox,, Beta version expired, `n Pls contact Lemming for new version. `n`n
ExitApp
}
Return

get all time same ERROR.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 7th, 2006, 5:41 am 
this script work as its own, but if I put it in the beginning of my scripts, they don't work :-(



; ------------------
; Check For Expiry routine
; ------------------
CheckExpiry:
FormatTime, CurrentYear , YYYY, yyyy
FormatTime, CurrentMonth , MM, M
If (CurrentYear > 2006 Or CurrentMonth > 8) ; valid till Sept 1.
{
MsgBox,, Beta version expired, `n Pls contact Lemming for new version. `n`n
ExitApp
}
Return


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 7th, 2006, 11:24 am 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
Remove the Return so AHK will continue to the next lines of code...
And in the Gosub command, you must not put the colon, only after the label definition.

Note this is a problem many shareware authors are trying to solve, without perfect solution.
I hate the "hidden registry key" trick: you try a software, remove it, and you get garbage in your registry, cumulating with the trials.
And anyway, I would use Regmon to see what is going on in the registry... And Filemon in case it checks some file.

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 7th, 2006, 11:45 am 
Offline

Joined: August 24th, 2005, 5:17 pm
Posts: 1237
Maybe there is a file which always gets modified when the computer boots up (hence its date changes) - you could read its date to check that the date of that file wasn't AFTER the system date (i.e. someone tried changing the date manually before running your script to a time when the script hadn't "expired").


Report this post
Top
 Profile  
Reply with quote  
 Post subject: maybe check index.dat
PostPosted: March 7th, 2006, 11:46 am 
Offline

Joined: December 20th, 2005, 4:15 am
Posts: 165
Location: Malaysia
I thought of checking the file date from index.dat instead of the system date which can be faked.

index.dat is apparently used and updated by IE, and is present on any Windows PC. The file's access date and modification date are usually current, so that could be used to find out the "real" system date.

For Win2K and WinXP, it is usually in:

\Documents and Settings\<Username>\Cookies\index.dat

Not many users know it even exists.

More details from:
http://www.acesoft.net/delete_index.dat_files.htm

Interestingly, there seems to be a whole bunch of utilities and discussions dedicated to removing this particular file!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 7th, 2006, 11:51 am 
TotalUninstall !


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 7th, 2006, 12:01 pm 
The script is working :-) nice solutions, but a solution with a hidden registry key seems to be better and more secure. Has somebody a similar easy solution?


Report this post
Top
  
Reply with quote  
 Post subject: Re: Expiry date
PostPosted: March 7th, 2006, 1:40 pm 
Offline

Joined: February 7th, 2005, 11:11 am
Posts: 192
Location: Munich, Germany
Lemming wrote:
If (CurrentYear > 2006 Or CurrentMonth > 8 )

Should be AND, not OR. With OR your proggy stops also at September, 1st 2005 or January, 1st 2006. (OR means one of both has to be valid.)

*tested*

:wink:

_________________
Peter

Wisenheiming for beginners: KaPeGe (German only, sorry)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 7th, 2006, 2:04 pm 
can you explain it what do you mean with "AND" "Or" with an example please?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 7th, 2006, 2:14 pm 
Truth, the proggy stop to work on the 1 january 2007 herewith:

If (CurrentYear > 2006 Or CurrentMonth > 8 )

But if I'm using the AND command and not Or it does not work also :-(
And I was sooo happy.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 7th, 2006, 2:32 pm 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
The call to FormatTime given by Lemming is a bit strange, or out of context.
Code:
CheckExpiry:
FormatTime currentYear, , yyyy
FormatTime currentMonth, , M
;~ MsgBox Y: %currentYear%`nM: %currentMonth%
If ((currentYear = 2006 and currentMonth > 8) or currentYear > 2006)   ; valid till Sept 1st, 2006
{
   MsgBox Beta version expired`nContact author for new version.
   ExitApp
}
Return

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Last edited by PhiLho on March 7th, 2006, 2:40 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 49 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: migz99, sjc1000 and 75 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group