AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

time limit like a trial software for script, how to do it?
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Lemming



Joined: 20 Dec 2005
Posts: 158
Location: Malaysia

PostPosted: Tue Mar 07, 2006 1:34 pm    Post subject: Re: Expiry date Reply with quote

Yea, I'm sure someone could do all this in a single line. Wink

But I wanted something readable and easily changed.

I figured since my script deals with the current (presumed) correct date, and time- travel has not been invented yet, then I wouldn't have to be concerned about any date before 2006.

Anyway, if you stuck an AND there, the script would start working again on Jan 2007 (CurrentMonth would become 1).

kapege.de wrote:
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
Back to top
View user's profile Send private message
Lemming



Joined: 20 Dec 2005
Posts: 158
Location: Malaysia

PostPosted: Tue Mar 07, 2006 1:45 pm    Post subject: Reply with quote

*Shrug* seems to work on my PC, and three other PCs I tested on. Plus the script logic seems sound to me - barring time-travel, or someone changing the PC's date.

Anyway, I just cobbled it together from rooting about the helpfile. Is there a better method to extract current system date, then make a comparison?

Would like to know for future improvement.

Thanks,
Lemming

PhiLho wrote:
The call to FormatTime given by Lemming is a bit strange, or out of context.
Back to top
View user's profile Send private message
Guest






PostPosted: Tue Mar 07, 2006 1:52 pm    Post subject: Reply with quote

This script is also not working. The proggy do not stop to work.

CheckExpiry:
FormatTime currentYear, , yyyy
FormatTime currentMonth, , M
;~ MsgBox Y: %currentYear%`nM: %currentMonth%
If ((currentYear = 2006 and currentMonth > Cool or currentYear > 2006) ; valid till Sept 1st, 2006
{
MsgBox Beta version expired`nContact author for new version.
ExitApp
}
Back to top
Stefan16
Guest





PostPosted: Tue Mar 07, 2006 1:57 pm    Post subject: Reply with quote

Hurra- this script do it - thanks. Untill now I have found no bug on it Smile

CheckExpiry:
FormatTime currentYear, , yyyy
FormatTime currentMonth, , M
;~ MsgBox Y: %currentYear%`nM: %currentMonth%
If ((currentYear = 2007 and currentMonth > 3) or currentYear > 2007) ; valid till Sept 1st, 2006
{
MsgBox Beta version expired`nContact author for new version.
ExitApp
}
Back to top
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Tue Mar 07, 2006 2:49 pm    Post subject: Reply with quote

Anonymous wrote:
This script is also not working. The proggy do not stop to work.
If ((currentYear = 2006 and currentMonth > 8 ) or currentYear > 2006) ; valid till Sept 1st, 2006
We are not in September, yet...

Stefan16 wrote:
If ((currentYear = 2007 and currentMonth > 3) or currentYear > 2007) ; valid till Sept 1st, 2006

You should update the comment...
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
Stefan16
Guest





PostPosted: Tue Mar 07, 2006 3:29 pm    Post subject: Reply with quote

Smile so the last script you adviced is perfekt PhiLho. Thank you.

Quote:
If ((currentYear = 2007 and currentMonth > 3) or currentYear > 2007) ; valid till Sept 1st, 2006


why do I need to update
Quote:
"valid till Sept 1st, 2006"
?? is it not only a comment for the programmer??

The proggy is working untill 1 of April 2007 and than the messagebox appears Surprised
Back to top
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Tue Mar 07, 2006 3:57 pm    Post subject: Reply with quote

Stefan16 wrote:
why do I need to update
Quote:
"valid till Sept 1st, 2006"
?? is it not only a comment for the programmer??

The proggy is working untill 1 of April 2007 and than the messagebox appears Surprised

Because it is confusing for the programmer! Very Happy He (she) see this code, and wonder if the comment is right and the code is wrong or the reverse...
Even if the programmer is only you, you may be confused months later...
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
TDMedia



Joined: 26 Nov 2005
Posts: 196

PostPosted: Fri Mar 10, 2006 3:13 am    Post subject: Reply with quote

PhiLho wrote:

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.


Generally speaking, I do too. That's why I also like to use installers that remove all signs of themselves when the uninstall app is run. InnoSetup is one example. The registry is screwed up as it is, and by no means should garbage be left there. As for the programs to monitor registry changes - the point I was making is that most users don't know about such apps, therefore a hidden entry can work in most cases. If you wanted to be really nasty to everyone, you could add a line of code that checks to see if the entry exists, and if not, disable itself. Honestly, I don't think that it should be a problem at all; all software that I create is free and stays free forever. I can see how someone may want to make a profit on software.... but I don't personally do it.
Back to top
View user's profile Send private message
Lemming



Joined: 20 Dec 2005
Posts: 158
Location: Malaysia

PostPosted: Fri Mar 10, 2006 5:53 am    Post subject: For beta control Reply with quote

Well, it's not always about profits or payment. Right now I don't charge anyone for my software even though it is used in a production environment.

In my case, the expiry date is simply because I don't want any copies of a beta version floating around after a certain date. My software doesn't have copy-protection or user/pc restrictions.

Anonymous wrote:

...
If you wanted to be really nasty to everyone, you could add a line of code that checks to see if the entry exists, and if not, disable itself. Honestly, I don't think that it should be a problem at all; all software that I create is free and stays free forever. I can see how someone may want to make a profit on software.... but I don't personally do it.
Back to top
View user's profile Send private message
TDMedia



Joined: 26 Nov 2005
Posts: 196

PostPosted: Fri Mar 10, 2006 7:13 am    Post subject: Reply with quote

Well, that's very different. Like mentioned earlier, the target expiration can just be coded right into it.
Back to top
View user's profile Send private message
Stefan16
Guest





PostPosted: Fri Mar 10, 2006 3:38 pm    Post subject: Reply with quote

Quote:
expiration can just be coded right into it.


And how...?
Back to top
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Fri Mar 10, 2006 4:11 pm    Post subject: Reply with quote

The way you did...
TPMedia means that the expiration data can be hardcoded in the script: that's not "use this software 30 days and pay or burst", but "this software is good until this date, after that, it will decay"...
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
Stefan16
Guest





PostPosted: Fri Mar 10, 2006 4:19 pm    Post subject: Reply with quote

The last script is very good, problem only that if you turn the date back, the software is working again.
Back to top
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Fri Mar 10, 2006 4:34 pm    Post subject: Reply with quote

Yes, it is OK for Lemming as users will probably prefer to get the latest version (hoping that there is one ready Smile) rather than messing with the clock.
For more robust solutions, reread the topic...
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Fri Mar 10, 2006 5:04 pm    Post subject: Reply with quote

Sure PhiLho, this is a nice solution, but for me it is like a "half" solution because I don't want that anyone at school will use some of my applications that are not ready and just for testing for ever.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group