I've created a couple of minor utilities for the field that I work in. I would like to sell these programs but I would also like to allow a user the ability to download the software try it for a period of time, and then have the option to put in a registration code to unlock the software so it will work beyond a period of time.
I'm not sure exactly how to do this. Any suggestions on where to begin?
Created software that I want to sell.
Moderators: JRL, Dorian (MJT support)
This is simplistic but the logic should work.
You might want to store the registration data in some obscure registry value rather than a text file in the temp directory. You would also probably want to encrypt the data. This sample script assumes you would have one registration code that would be built into the script. You could do this and then send out individual programs each with a unique registration built in if unique registrations are important. Or you could attempt to develop some sort of algorithm that deciphers the registration data. You might also include some sort of web authentication before you write the registration data.
There are so many possibilities. It depends on how important this is to you and how likely it is that users would share registrations.
Thae "dateDiff" code has been posted many times, the earliest I found was by Bob Hansen HERE. The version I used was posted by Marcus HERE.
Here's a sample:
You might want to store the registration data in some obscure registry value rather than a text file in the temp directory. You would also probably want to encrypt the data. This sample script assumes you would have one registration code that would be built into the script. You could do this and then send out individual programs each with a unique registration built in if unique registrations are important. Or you could attempt to develop some sort of algorithm that deciphers the registration data. You might also include some sort of web authentication before you write the registration data.
There are so many possibilities. It depends on how important this is to you and how likely it is that users would share registrations.
Thae "dateDiff" code has been posted many times, the earliest I found was by Bob Hansen HERE. The version I used was posted by Marcus HERE.
Here's a sample:
Code: Select all
Let>file1=%temp_dir%ApplicationTimeout.txt
IfFileExists>file1
ReadLn>file1,1,TargetDay
If>TargetDay=TheSecretCode,Passed
ReadLn>file1,2,TargetMonth
ReadLn>file1,3,TargetYear
VBSTART
VBEND
VBEval>DateDiff("d",Date(),DateSerial(%TargetYear%,%TargetMonth%,%TargetDay%)),daysDif
Let>daysDif={abs(%daysDif%)}
If>daysDif>30
Input>answer,The application has expired Do you have a code?
If>answer=TheSecretCode
DeleteFile>file1
WriteLn>file1,wres,TheSecretCode
Goto>Passed
EndIf
Exit>0
Else
Input>answer,Enter Code or leave blank for 30 day free trial
If>answer=TheSecretCode
DeleteFile>file1
WriteLn>file1,wres,TheSecretCode
Goto>Passed
EndIf
EndIF
Else
Input>answer,Enter Code or leave blank for 30 day free trial
If>answer=TheSecretCode
WriteLn>file1,wres,TheSecretCode
Goto>Passed
EndIf
Day>dd
Month>mm
Year>yyyy
WriteLn>file1,wres,%dd%%crlf%%mm%%crlf%%yyyy%%crlf%
EndIf
Label>Passed
MDL>Run the rest of the app.
Thank you for the help. I didn't even think of web registration which should work perfect because the only way a user would be able to use this utility would be to be online.JRL wrote:This is simplistic but the logic should work.
You might want to store the registration data in some obscure registry value rather than a text file in the temp directory. You would also probably want to encrypt the data. This sample script assumes you would have one registration code that would be built into the script. You could do this and then send out individual programs each with a unique registration built in if unique registrations are important. Or you could attempt to develop some sort of algorithm that deciphers the registration data. You might also include some sort of web authentication before you write the registration data.
There are so many possibilities. It depends on how important this is to you and how likely it is that users would share registrations.
Thae "dateDiff" code has been posted many times, the earliest I found was by Bob Hansen HERE. The version I used was posted by Marcus HERE.
Here's a sample:
Code: Select all
Let>file1=%temp_dir%ApplicationTimeout.txt IfFileExists>file1 ReadLn>file1,1,TargetDay If>TargetDay=TheSecretCode,Passed ReadLn>file1,2,TargetMonth ReadLn>file1,3,TargetYear VBSTART VBEND VBEval>DateDiff("d",Date(),DateSerial(%TargetYear%,%TargetMonth%,%TargetDay%)),daysDif Let>daysDif={abs(%daysDif%)} If>daysDif>30 Input>answer,The application has expired Do you have a code? If>answer=TheSecretCode DeleteFile>file1 WriteLn>file1,wres,TheSecretCode Goto>Passed EndIf Exit>0 Else Input>answer,Enter Code or leave blank for 30 day free trial If>answer=TheSecretCode DeleteFile>file1 WriteLn>file1,wres,TheSecretCode Goto>Passed EndIf EndIF Else Input>answer,Enter Code or leave blank for 30 day free trial If>answer=TheSecretCode WriteLn>file1,wres,TheSecretCode Goto>Passed EndIf Day>dd Month>mm Year>yyyy WriteLn>file1,wres,%dd%%crlf%%mm%%crlf%%yyyy%%crlf% EndIf Label>Passed MDL>Run the rest of the app.
Hmmm you have given me a lot to think about, thank you!