Board index » delphi » Built in time-limit

Built in time-limit

I would like to know if there is a way in Delphi to make a program erase
 itself.

I would like to send a sample program to someone and have it "kill" itself
 after a certain computer date. I really don't care whether it is easy for them
 to "hack it" out because I don't think they are that savvy. And the program is
 not that valuable.

Thanks

Bill Burt, Jr.
BBur...@AOL.COM

 

Re:Built in time-limit


BBurtjr <bbur...@aol.com> schrieb im Beitrag
<19971005152300.LAA09...@ladder02.news.aol.com>...

Quote
> I would like to know if there is a way in Delphi to make a program erase
>  itself.

What a MEAN idea!

Quote
> I would like to send a sample program to someone and have it "kill"
itself
>  after a certain computer date.

Perhaps you should show the order form instead of the program main window
when testing period has expired...

--
Holger Walz
Berlin, Germany
EMail: <holger.w...@metronet.de>

Re:Built in time-limit


Quote
>BBurtjr <bbur...@aol.com> schrieb im Beitrag
><19971005152300.LAA09...@ladder02.news.aol.com>...
>> I would like to know if there is a way in Delphi to make a program erase
>>  itself.
>> I would like to send a sample program to someone and have it "kill"
>itself
>>  after a certain computer date.

I even doubt that this is allowed. I thought there was somekind of law against this.

Re:Built in time-limit


Holger Walz <holger.w...@metronet.de> wrote in article
<01bcd415$2cd09480$LocalHost@holger>...

Quote

> BBurtjr <bbur...@aol.com> schrieb im Beitrag
> <19971005152300.LAA09...@ladder02.news.aol.com>...
> > I would like to know if there is a way in Delphi to make a program
erase
> >  itself.
> What a MEAN idea!
> > I would like to send a sample program to someone and have it "kill"
> itself
> >  after a certain computer date.
> Perhaps you should show the order form instead of the program main window
> when testing period has expired...

_________________________________________

The technique I've used for this is a (very small) exe that installs itself
with the main app. The small exe is executed from the main app's main
FormCreate and  evaluates ParamStr[1]. If ParamStr[1] evaluates as true,
the small exe closes itself down. If ParamStr[1] evaluates as false, it
finds and closes the parent application (two lines of code), then erases it
and creates a small text file with the same name as the app it erased.
_________________________________________

  ?  Leigh Harrison      
  ?  tel +64 6 343 2671
  ?  fax +64 6 343 2649
  ?  mobile 025 933 913
  ?  email le...@radiOshop.co.nz
  ?  3 Iris Place Wanganui New Zealand
_________________________________________
                             radiOshop

Re:Built in time-limit


r...@ktibv.nl (The Graphical Gnome) writes:

Quote
>>BBurtjr <bbur...@aol.com> schrieb im Beitrag
>><19971005152300.LAA09...@ladder02.news.aol.com>...
>>> I would like to know if there is a way in Delphi to make a program erase
>>>  itself.
>>> I would like to send a sample program to someone and have it "kill"
>>itself
>>>  after a certain computer date.
>I even doubt that this is allowed. I thought there was somekind of law against this.

I think you're right. I'm no lawyer, but in many countires it falls under
the laws used to characterise viruses... ie. the program would be secretly
altering your hard disk without your knowledge or consent, even if all it
does is delete itself.

--
Paul Gilbert           | p...@yallara.cs.rmit.edu.au
Bach App Sci, Bach Eng | The opinions expressed are my own, all my own, and
Year 4, RMIT Melbourne | as such will contain no references to small {*word*141}
Australia              | creatures from Alpha Centauri.

Re:Built in time-limit


Quote
>r...@ktibv.nl (The Graphical Gnome) writes:

>>>BBurtjr <bbur...@aol.com> schrieb im Beitrag
>>><19971005152300.LAA09...@ladder02.news.aol.com>...
>>>> I would like to know if there is a way in Delphi to make a program erase
>>>>  itself.
>>>> I would like to send a sample program to someone and have it "kill"
>>>itself
>>>>  after a certain computer date.

>>I even doubt that this is allowed. I thought there was somekind of law against this.

A better way to do it would be for the program to refuse to run, and
display a message telling them where to purchase the full version.

Turbopower makes a toolkit called OnGuard that handles time-outs, and
lets you give the customer an unlock code to make the program work
again. http://www.turbopower.com

Chuck Gadd
Director of Software Development, {*word*104} FX Communications.
e-mail:cgadd-NOS...@{*word*104}-fx.com  http://www.csd.net/~cgadd
Remove the -NOSPAM from my email address to send me e-mail.
*** I boycott businesses that send me unsolicited email adverti{*word*224}ts ***

Re:Built in time-limit


Bill,

1. you could use a very small exe to load first, if the expiration date
is out then delete the main file, otherwise load the main file and unload
the small file.

2. Be sneeky and at the last time (run of program) before the reg date
expires edit the "autoexec.bat" and insert a line that checks if your exe
exists and if it does, then delete it :)

Lastly, do be careful with deleting a file from someones hard-disk as
against simply disabling it ... I remember reading some months back that
a court in the states ruled against a developer who did just that - as I
remember it (and don't quote me!) it was held that the programmer invaded
the privacy of the owner of the PC or something like that ... bottom line
is that the programmer lost the case and had to pay $$$

Better do as everyone else does and simply disable the prog!
Chio!

- Allen.

[This followup was posted to comp.lang.pascal.delphi.misc and a copy was
sent to the cited author.]

In article <19971005152300.LAA09...@ladder02.news.aol.com>,
bbur...@aol.com says...

Quote
> I would like to know if there is a way in Delphi to make a program erase
>  itself.

> I would like to send a sample program to someone and have it "kill" itself
>  after a certain computer date. I really don't care whether it is easy for them
>  to "hack it" out because I don't think they are that savvy. And the program is
>  not that valuable.

> Thanks

> Bill Burt, Jr.
> BBur...@AOL.COM

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
remove the NO from my address to reply ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Re:Built in time-limit


In article <MPG.ea61d37a917330e989...@news.indigo.ie> tec...@cargo.iol.ie (Allen Stoner O'Neill) writes:

Quote
>Better do as everyone else does and simply disable the prog!
>Chio!
>> I would like to send a sample program to someone and have it "kill" itself
>>  after a certain computer date. I really don't care whether it is easy for them
>>  to "hack it" out because I don't think they are that savvy. And the program is
>>  not that valuable.

My feeling on this subject is that programmers can waste an inordinate amount
of time trying to protect a program, certain that the reason why it's not
selling is that programmers are cracking it.  Usually the reason is either
that people don't know about it or they don't need it.

Your time-limit/expiration system should be a registration "incentive."  Those
people who will then avail themselves of any and all means to bypass your
protection .. will do it.  But if your product is reasonably priced, does what
it says it will do, and is well supported, most people will gladly pay.  

For example, our ChimneySweep? product, which btw is an automated table
maintenance tool for Paradox/BDE, has sold more than 400 licenses in 12
foreign countries in the past eigh{*word*249} months.  Many of these are repeat and
volume-sales to prior customers.  (http://www.sundialservices.com)

It is not outrageously protected, if you are determined, because I do not want
to inconvenience our customers unduly.  "If you're not going to be a customer,
then I can't help it.  But if you are, I don't want to annoy you excessively."
We do change the protection system from time to time and we will be replacing
it this year, but the point is that the product works, it's reasonably priced,
and we respond very promptly to each inquiry about it.  We make it worth
buying.

You can easily lose sleep worrying about theft, but stores call it "shrinkage"
and move on.  Famous retailers like Lands' End even go so far as to simply
say, "Guaranteed, Period.?" -- knowing that a small percentage of their
customers will buy a shirt, wear it for a year, claim it is "defective" and
ask for their money back.  They get it.  "Period."

/mr/

Re:Built in time-limit


Quote
>> I would like to know if there is a way in Delphi to make a program erase
>>  itself.

There's no easy way to delete the application file while the program is
still running... simply because while the app is running the file is locked
for reading.  One easy way to get around this is to place your splashscreen
in a separate program which does nothing but, well, display the splashscreen
and then execute the program.  If the expiration date has passed, instead of
doing a WinExec, simply do a DeleteFile, e voila, you're program is in the
computer's nirvana.

This still doesn't solve your problem though.  Any computer user with a bit
of knowledge can recover the executable from a backup or the original
distribution.  You could do something as simple as
if Date>EncodeDate(1997,12,31) then Application.Terminate
somewhere in the beginning of the code.  But hey, Microsoft did that in the
FrontPage 97 beta, and I know several people who are still using that
"expired version."

Here's what I've come up with as my best solution yet --
Most programs either have an INI file or a section in the registry.
Somewhere deep down in that registry or INI section, hide a "magical key"
with an inconspicuous name.  I use things such as
"Software/MyProgram/CurrentVersion/Options/ColorList" in the registry, and
make that key a binary data field.
When the program starts up, here's what it does:
First it encrypts the current date, then adds a random string, finally add's
an MD-5 signature or some other for of checksum to that string.  The whole
she-bang is then saved into that bogus key above.
A very simplified example would be:
12/1/1997 --> "01 02 00 01 19 09 07" plus random: "00 39 23 22 99 88 12"
checksum: "04 02 01"
and the key will contain:
01 02 00 01 19 09 07 00 39 23 22 99 88 12 04 02 01
further down in the program code, this same key is extracted again -- if the
checksum is invalid, or the key is not found, the program will terminate.
If the encrypted date is after the expiration date, the program will also
terminate.  Obviously a similar check has to go before the
date-encryption/storage.  This way, a program that is started ONCE after the
expiration date will NEVER run again.
CAVEAT -- make sure you address this issue if someone upgrades your program
to the paid (non-expiring) version... otherwise the program will never run
again.  Also, be certain you "clean up after yourself" so if someone removes
your program that key will be removed too.

Enjoy,
UG

Re:Built in time-limit


You can set the file date to the systemtime during instalation and earse
it after a certain period.

If you have no installation for your program, you can e.g set the date
to a very early date. Your program checks for this date and set it to
the system date. by the next run, you can decide if you would like to
delete it.

Sven

Quote
> I would like to know if there is a way in Delphi to make a program
> erase
>  itself.

> I would like to send a sample program to someone and have it "kill"
> itself
>  after a certain computer date. I really don't care whether it is easy
> for them
>  to "hack it" out because I don't think they are that savvy. And the
> program is
>  not that valuable.

> Thanks

> Bill Burt, Jr.
> BBur...@AOL.COM

Re:Built in time-limit


Quote
Sundial Services (news-re...@sundialservices.com) wrote:

: Your time-limit/expiration system should be a registration "incentive."  Those
: people who will then avail themselves of any and all means to bypass your
: protection .. will do it.  But if your product is reasonably priced, does what
: it says it will do, and is well supported, most people will gladly pay.  

yeah

: For example, our ChimneySweep? product, which btw is an automated table
: maintenance tool for Paradox/BDE, has sold more than 400 licenses in 12
: foreign countries in the past eigh{*word*249} months.  Many of these are repeat and
: volume-sales to prior customers.  (http://www.sundialservices.com)

also, I tend to think that most people will pay for software from a smaller company, but not feel guilty if they are using "freebies"
from larger ones (MS, Borland, Adobe, etc).  Its almost a "rob from the rich and give to the poor" kinda thing.

just a thought

wooz

Re:Built in time-limit


Don't mess with erasure. That could go wrong and leave you liable for
damages. At install time you could set up registry entries (say an
encrypted licence code). Without this entry code the program won't run.
Now everytime the program runs, decrpyt the registry entry, subtract 1,
reencrypt and output it. When it reaches zero, program terminates with a
'missing licence file' error. (To confuse the user).

You should store the original encryopted licence number on disk and
everytime the user goes to install the program again, if the registry
entry exists at install time (which it obviously won't, the first time
the program in installed), copy it over the value on the install disk.

The user might think to use an old copy of the registry but by then the
original install disks will have been repatched.

Other similar methods involve creating a limited time use licence
string. This is only valid for a range of dates and lives in a little
binary file. If this file is absent the program stops. Encrypted within
this licence string should be the date you created it. This date is
always changed by the use of your program, but it is only allowed to
change forward. Every time the program is run, it compares the stored
date with computer date. If the computer date has been set back, the
program stops. To stop a copy of the original licence file being copied,
keep a copy of the contents in the registry and update it accordingly.
(To confuse matters further, make the two copies different. If both are
(say) a 32 character string, reverse one copies sequence of bytes and
xor with 127.

In article <EHrwzK....@ktibv.nl>, The Graphical Gnome <r...@ktibv.nl>
writes

Quote
>>BBurtjr <bbur...@aol.com> schrieb im Beitrag
>><19971005152300.LAA09...@ladder02.news.aol.com>...
>>> I would like to know if there is a way in Delphi to make a program erase
>>>  itself.
>>> I would like to send a sample program to someone and have it "kill"
>>itself
>>>  after a certain computer date.

>I even doubt that this is allowed. I thought there was somekind of law against
>this.

--
David H. Bolton

I've just fallen in love - with an email. Now Concentrate....
This message has not been tested on any live animal before posting.
Emails formulated and controlled by laboratoire Bolton

Re:Built in time-limit


Quote
Leigh Harrison wrote:

> Holger Walz <holger.w...@metronet.de> wrote in article
> <01bcd415$2cd09480$LocalHost@holger>...

> > BBurtjr <bbur...@aol.com> schrieb im Beitrag
> > <19971005152300.LAA09...@ladder02.news.aol.com>...
> > > I would like to know if there is a way in Delphi to make a program
> erase
> > >  itself.
> > What a MEAN idea!
> > > I would like to send a sample program to someone and have it "kill"
> > itself
> > >  after a certain computer date.
> > Perhaps you should show the order form instead of the program main window
> > when testing period has expired...
> _________________________________________

> The technique I've used for this is a (very small) exe that installs itself
> with the main app. The small exe is executed from the main app's main
> FormCreate and  evaluates ParamStr[1]. If ParamStr[1] evaluates as true,
> the small exe closes itself down. If ParamStr[1] evaluates as false, it
> finds and closes the parent application (two lines of code), then erases it
> and creates a small text file with the same name as the app it erased.
> _________________________________________

>   ?  Leigh Harrison
>   ?  tel +64 6 343 2671
>   ?  fax +64 6 343 2649
>   ?  mobile 025 933 913
>   ?  email le...@radiOshop.co.nz
>   ?  3 Iris Place Wanganui New Zealand
> _________________________________________
>                              radiOshop

Hi,
Just slightly off topic, but still:

This here little piece of code GOT to be the quickest way to create a
true shareware nag, that gives people the full functionality of the
program, yet nags people big time untill they register (cruel, huh :) )

This shareware nag makes sure that the user can only execute your
program ONCE every Windows session.

In your FormShow event:

procedure TForm1.FormShow(Sender : TObject);
var atom : integer;
    CRLF : string;
begin
    if
GlobalFindAtom('THIS_IS_SOME_OBSCUREE_TEXT_LIKE_EKEE_EKEE_EKEE_TAPAAAANG')
= 0 then
       atom :=
GlobalAddAtom('THIS_IS_SOME_OBSCUREE_TEXT_LIKE_EKEE_EKEE_EKEE_TAPAAAANG')
else
       begin
          CRLF := #10 + #13;
          ShowMessage('This version may only be run once for every
Windows Session.' + CRLF +
                      'To run this program again, you need to restart
Windows, or better yet:' + CRLF +
                      'REGISTER !!');
          Close;
       end;
end;

The advantages here are that you leave all the functionallity at the
users disposal, but the moment he closes the program, its bootie-time,
folks ! All you got to do is write some obscure text and save it in the
Windows global atom table.

Best regards,
Karsten Heitmann

Other Threads