May 04, 2024, 09:20:15 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Demo/Registration Code Tricks

Started by tbohon, June 13, 2007, 01:48:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tbohon

Am curious to know if anyone has implemented an algorithm to make a program act as a 'demo' or 'trial' for x days, deactivating or restricting functionality after that date.

Not a pressing need - just had a program do that to me (I have since purchased it) and am curious to know how it's done.

Tnx in advance.

Tom
"If you lead your life the right way, the karma will take care of itself ... the dreams will come to you."  -- Randy Pausch, PhD (1961-2008)

pistol350

I don't have any working code to show , but brewsing my Eba user guide i found some tips.
I just hope it give you a mere idea on what you really want to see.
Cheers!
Peter

QuoteCreating a conditional identifier

A conditional identifier is a word or sequence of letters and numbers that you want to define as TRUE to the preprocessor. Think of them as a constant without any real value. They are only visible to the preprocessor and are created with the $DEFINE statement. For example suppose you have two versions of your program, a trial version and a paid for version. Maintaining two separate projects would be a solution but its much easier to write the source so you can quickly compile one or the other.

$DEFINE TRIAL_VERSION

Would define the identifier TRIAL_VERSION as TRUE to the preprocessor.


Excluding or including code to be compiled

Using the preprocessor commands $IFDEF, $IFNDEF, $ELSE and $ENDIF you can test for a conditional identifier and include or exclude any section of code necessary. Using the identifier from above:

$IFDEF TRIAL_VERSION
    ShowRegisterDialog( )
    Save_Allowed = FALSE
$ELSE
    ShowWelcomeDialog( )
    Save_Allowed = TRUE
$ENDIF

It is important to note that the preprocessor statements are not actually program statements but control what the compiler processes. In our hypothetical trial version/full version code above if the identifier TRIAL_VERSION has been defined then a registration dialog would be shown and saving files disabled. The code to show the welcome dialog is skipped entirely and would not generate any machine code in the executable.

Conditional compiling statements can be nested to allow for advanced situations. Continuing with our hypothetical trial version and we wanted to maintain debugging code in the source:

$IFDEF TRIAL_VERSION
    ShowRegisterDialog( )
    Save_Allowed = FALSE
    $IFDEF DEBUG
        MESSAGEBOX win1,key$,"Key"   
    $ENDIF
$ELSE
    ShowWelcomeDialog( )
    Save_Allowed = TRUE
    $IFDEF DEBUG
        DEBUGPRINT "Program started: Registered name = " + name$
    $ENDIF
$ENDIF

For situations where you only need a negative test just use $IFNDEF

$IFNDEF DEBUG
    ShowWelcomeDialog( )
$ENDIF
Regards,

Peter B.

Bruce Peaslee

One popular (but not free) method is to use a program like Software Passport (used to be called Armadillo).

I use it and it does a lot more than just that. Google for it if you are interested.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

tbohon

Thanks for the comments.  Both have merit and make sense.

Just to take this one more step, how do you suppose they do it when you download a trial version and then, after paying, enter an unlock code to convert the trial version to a full version?  I'm guessing they write the code to an obscure (probably hidden) file somewhere on the system and the software always checks for it to decide if it's a trial or full version of the software maybe ... ?????

Again, just curiosity ...

Tom
"If you lead your life the right way, the karma will take care of itself ... the dreams will come to you."  -- Randy Pausch, PhD (1961-2008)

Ionic Wind Support Team

I know exactly how they do it ;).   Anyway don't use the demo/full with an unlock key method.  I did that with the original IBasic and you woudn't beleive how easy it is for hackers to trick your demo into thinking it's a full version.

Have two separate versions.  A feature limited demo with a time limit and a full version with a key.  When a customer pays send them the full version and their key.  Armadillo (Software Passport) allows you to build keyed version that have banned keys encrypted in the executable, which allows you to disable a users key if they "share" it.

And no, they don't use a hidded file.  Most use a hidden, encrypted, registry key that is based on a hash of other keys in the registry such as the Windows serial number.  If you were to copy/paste the users hidden registry key to a new computer then the program still wouldn't work until installed with the correct key. 

Armadillo has other features too.  Nanobots which check for tampering of the executable, debugger detector which stops the execution of a program when a debugger is running it, etc. 

Paul.

Ionic Wind Support Team

peterpuk

Just getting a little off track, but when you purchase a second copy of an ionicwind product, you mention that you can give it to a friend.

Doesn't this friend then use your name and the new reg code?
Peter

Ionic Wind Support Team

Just PM me the friends name and I will take give you a key.
Ionic Wind Support Team

tbohon

Thanks all for the responses.  Not sure why I decided I needed to know how this is done ... but I consider it a privilege of hitting the big '6-0' last December ... I can ask silly questions and blame it on my age if questioned by anyone!!!  ;D

Y'all have a great weekend - it's raining here in Olympia, WA so I may get out of working in the pasture this weekend (if I'm lucky).

Tom
"If you lead your life the right way, the karma will take care of itself ... the dreams will come to you."  -- Randy Pausch, PhD (1961-2008)

Rock Ridge Farm (Larry)

We should have a 60 club - I hit 60 this year and a couple of others are 60+

LarryMc

Quote from: Rock Ridge Farm (Larry) on June 15, 2007, 11:03:59 AM
We should have a 60 club - I hit 60 this year and a couple of others are 60+

If you're like me you won't remember you belong to it. :D


LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

tbohon

"If you lead your life the right way, the karma will take care of itself ... the dreams will come to you."  -- Randy Pausch, PhD (1961-2008)

Rock Ridge Farm (Larry)


Bruce Peaslee

My wife says I'm not closing in on 60, but reaching six for the tenth time.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

jerryclement

 :o  :'(
Let's hurry, I'll be 69 in September!!

Jerry C.
Jerry - Newbie from TN

tbohon

Actually I've been telling my co-workers - all of whom are about the age of my oldest son (late 30s) - that I'm really not 60, I'm 39 with 21 years' experience.  The really sad part is that a couple of them didn't realize what I meant ... kind of like the gal at McDonald's the other day who, when their computer went down, tried to give me $23 in change for a $3 purchase for which I'd given her a $20 bill.

<sigh>

Tom
"If you lead your life the right way, the karma will take care of itself ... the dreams will come to you."  -- Randy Pausch, PhD (1961-2008)

LarryMc

Quotetried to give me $23 in change for a $3 purchase for which I'd given her a $20 bill.

I run in to that on a regular basis at Sonic.  Say my order is $9.20.  I give them $11.00 and they ask me if I want my change without fail.

LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

REDEBOLT

Quote from: jerryclement on June 15, 2007, 06:30:21 PM
:o  :'(
Let's hurry, I'll be 69 in September!!

Jerry C.

Got you beat Jerry! I'll be 71 in September.   ;D
Regards,
Bob

LarryMc

Won't go into the why's and wherefores but the subject of guessing my age came up yesterday and today.  Neither time was I the instigater and both times it was by middle aged women.

Yesterday the guess I was 45.  Today the guess was 84.  I'm fixin' to turn 62.  The gal that guessed 84 seen me walk and the 1st one didn't. :o
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

jerryclement

June 16, 2007, 05:29:46 AM #18 Last Edit: June 16, 2007, 05:32:33 AM by jerryclement
Quote from: REDEBOLT on June 15, 2007, 10:50:00 PM


Got you beat Jerry! I'll be 71 in September.   ;D

:) :) That's great Bob, what day?  I'm the 5th, born on Labor Day.

Jerry C.
Jerry - Newbie from TN

REDEBOLT

Regards,
Bob

Jerry Muelver

Quote from: jerryclement on June 16, 2007, 05:29:46 AM
:) :) That's great Bob, what day?  I'm the 5th, born on Labor Day.
Jerry C.
I was also born on the 5th of September. It must be a "Jerry" thing. In fact, I'm the first of the "baby boom" generation, having been born exactly nine months after the Pearl Harbor attack.  I wanted to be an only child, but didn't quite make it. I'm not sure if it was "now or never" kind of thing, though it did turn out to be frequent thing, since I was the first of eight.  ::)

Allan

June 17, 2007, 06:10:32 PM #21 Last Edit: June 18, 2007, 01:38:48 PM by Allan
September 6th early 40's - and feeling the years.
Allan

tbohon

My problem is that mentally I feel like I'm still in my 40s but physically I feel like I'm about 122 ...  :-\
"If you lead your life the right way, the karma will take care of itself ... the dreams will come to you."  -- Randy Pausch, PhD (1961-2008)

jerryclement

 ;D
YEP Jerry M., it is a JERRY thing!!   :D

WOW, 365 to 1 shot. Wonder what the odds both have the same first name!!  ::)

Jerry C.  (Jerome)

Jerry - Newbie from TN

Jerry Muelver

The odds on two of 26 people in a room having the same birthday are about even. So if you got 26 Jerrys together....