How to analyze Date in order to make a DEMO expiration date

Hi all!

I making a demo of my software, that I want to be able tu run 30 days trial time.

I thought to do this, and when It comes to the mentioned day it doesn’t run anymore. But I’m seeing that after that date will run again:

[code] dim Fechas As New Date
Dim FechaDemo as String = Str(Fechas.ShortDate)

if FechaDemo = “15/04/16” Then
Msgbox “Sorry, the expiration time has finished” + EndOfLine + “Order a License” + EndOfLine + “Platypus Software” + EndOfLine + “E-mail: platy@me.com

Else
Msgbox “Welcome”
End If[/code]

What did you suggest
Thanks

[quote=259755:@Gerardo García]Hi all!

I making a demo of my software, that I want to be able tu run 30 days trial time.

I thought to do this, and when It comes to the mentioned day it doesn’t run anymore. But I’m seeing that after that date will run again:

[code] dim Fechas As New Date
Dim FechaDemo as String = Str(Fechas.ShortDate)

if FechaDemo = “15/04/16” Then
Msgbox “Sorry, the expiration time has finished” + EndOfLine + “Order a License” + EndOfLine + “Platypus Software” + EndOfLine + “E-mail: platy@me.com

Else
Msgbox “Welcome”
End If[/code]

What did you suggest
Thanks[/quote]
Sorry I think I got it, watching the Xojo documentation : D

What you are doing is not working on quite a few levels.

For one thing it will not work ON that date but will work again AFTER the date.

Secondly shortdate can be

15.04.16
04/15/16
Etc etc

Don’t compare strings. Compare dates.

[quote=259764:@Markus Winter]What you are doing is not working on quite a few levels.

For one thing it will not work ON that date but will work again AFTER the date.

Secondly shortdate can be

15.04.16
04/15/16
Etc etc

Don’t compare strings. Compare dates.[/quote]
Something like this right?:

[code] dim ExpirationDate As New Date
ExpirationDate.Year = 2016
ExpirationDate.Month = 04
ExpirationDate.Day = 14

Dim today as New Date //Obtiene la fecha de hoy

if ExpirationDate < Today Then
Msgbox “Expiration Time has come, please buy a License of this Software”

Else
Msgbox “Welcome to the Real of the desert”
End If[/code]

Now I’m Looking that If customer will change the Computers date, will avoid the restriction date.
Is there an additional way to protect it?

I’m thinking to use some kind of SOAP that gets NTP, but Currently I’m investigating

[quote=259768:@Gerardo García]Now I’m Looking that If customer will change the Computers date, will avoid the restriction date.
Is there an additional way to protect it?

I’m thinking to use some kind of SOAP that gets NTP, but Currently I’m investigating[/quote]

I found This on a website, In order to get NTP time that works very fine!:

[code] Private Function getInternetGMT() As Date
Dim t As new TCPSocket
Dim s As String
Dim TimeStamp As Double
Dim d As Date

t.Address = “time-nw.nist.gov” // You can also use other servers…
t.Port = 37
t.Connect

Do
t.Poll
s = t.ReadAll
Loop Until s <> “” Or t.LastErrorCode = 64

If s <> “” Then
d = New Date
TimeStamp = Asc(Left(s, 1)) * (256 ^ 3) + Asc(Mid(s, 2, 1)) * (256 ^ 2) + Asc(Mid(s, 3, 1)) * (256 ^ 1) + Asc(Right(s, 1))
d.TotalSeconds = TimeStamp - 1.261440e+8

Return d

End If

End Function[/code]

That would assume the user is online so not a good solution.

The best solution is to write a hidden file somewhere (with nothing in it). You can then read this files Created date.
This also has the advantage it will not show up in event trackers (like fsevent) when you read the date of the file - after all you do not really open the file. So it is harder to track down the file you created at first launch.

Unless the program’s function requires it to be online.

Again with the “please don’t be hiding files around your users computer”
It’s rude.
It’s sloppy.
It shows no respect for your user.

or if you wish to compare strings use the SQLDATE property of the DATE object
this also removes the stigma of hours/min/seconds during the day …which might be a problem if you compare totalseconds

[quote=259797:@Tim Parnell]Again with the “please don’t be hiding files around your users computer”
It’s rude.
It’s sloppy.
It shows no respect for your user.[/quote]

Which serious alternative do you have to enforce a 30 days trial that will not be defeated by a reinstall ? A call home ?

Besides, most commercial apps install at least some files in defaults and appData. Should it be considered sloppy, rude and disrespectful ?

[quote=259847:@Michel Bujardet]Which serious alternative do you have to enforce a 30 days trial that will not be defeated by a reinstall ? A call home ?

Besides, ALL apps install at least some files in defaults and appData. Should it be considered sloppy, rude and disrespectful ?[/quote]
Answering this breaks off into a DRM debate.

Storing your files inside your own folder in AppData is not all over the place and I would consider that acceptable, as I can completely uninstall the app by deleting just that folder. If you’re writing to files hidden throughout the system that aren’t in your apps own folder then I’d say you’re overreaching your welcome on someone else’s file system. This is one reason sandboxing is fantastic, you delete the sandbox and the app is GONE.

Time based trials aren’t always the answer, one may consider a different form of trial that encourages users to purchase instead of reset. Perhaps it unlocks more features instead, or removes a watermark.

Another way to implement a time trial would be to set up expiring license keys, and provide a demo one that lasts 30 days. You could do this either on the website by asking for an email to download or in-app by calling home. Be sure to ask your user about the call first, smart users will shut down unannounced connections.

I try to respect my user’s systems, treating it like I’m a guest in their home.

And we’re back to square one. How do you prevent users from defeating it by simply changing the date?

What about to save a file with the Date inside the file instead to check the creation date.
But use Encode64 to Encode the Date inside the file?

What did you think?

I wouldn’t know, I wasn’t answering that question :slight_smile:

[quote=259862:@Gerardo García]What about to save a file with the Date inside the file instead to check the creation date.
But use Encode64 to Encode the Date inside the file?

What did you think?[/quote]
Base64 doesn’t fool anybody.

there is a whole recent topic talking about just this thing, and there were numerous suggestions on ways to approach it

[quote=259851:@Tim Parnell]Another way to implement a time trial would be to set up expiring license keys, and provide a demo one that lasts 30 days. You could do this either on the website by asking for an email to download or in-app by calling home. Be sure to ask your user about the call first, smart users will shut down unannounced connections.

I try to respect my user’s systems, treating it like I’m a guest in their home.[/quote]

Tim, I understand you try to practice virtue. But if you go around, you will see tons of apps, especially in the Windows world, that offer full features 30 days evaluation.

I have practiced crippleware and watermarks for decades, but today I am going against a more established competitor who does the 30 days evaluation stuff. No call home, no license number. I would be dumb to offer less, people would laugh.

There is a world out there, that does not run necessarily on grand ideas.