Timed Usage

How can I set my program so that it will only run for a set number of days from date of installation. As in a lot of shareware programmes. I presume this is something to do with dates and registry?
LVL 1
xpherAsked:
Who is Participating?
 
ZifNabConnect With a Mentor Commented:
xpher,

here are free components with source :

http://www.torry.ru/vcl/security/arprotector.zip
http://www.torry.ru/vcl/security/registera.zip
http://www.torry.ru/vcl/security/mtsharware.zip
http://www.torry.ru/vcl/security/tshare.zip

free components without source :

http://www.torry.ru/vcl/security/easylic.zip

Regards, Zif.

Madshi, hope you don't mind I gave these links, I'm sure your example will be the same like these or even better.
0
 
scrapdogCommented:
>I presume this is something to do with dates and registry?

Yes.
0
 
MadshiCommented:
Just write the installation date to the registry (HKEY_LOCAL_MACHINE\Software\YourCompany\YourProgram\...). Then test on startup if the test period is gone by comparing the date from the registry with the current date.
Probably you should encrypt the registry value somehow...

Regards, Madshi.
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
xpherAuthor Commented:
Madshi
Sounds good. How?
Excuse me quite new to this.

Regards
Chris
0
 
MadshiCommented:
Zif, no problem!
If xpher like your links I can save the time to write some sources for him...

Regards, Madshi.
0
 
ZifNabCommented:
Hi Madshi, that's what I thought too... We all need our time and why not using already created code which is offered for free? See you Zif.
0
 
xpherAuthor Commented:
ZifNab
Thanks for component links. I've been trying the tshare I can get it to work but am still confused about how to stop it creating messages once the software is registered. Any comments

Many thanks
Chris
0
 
ZifNabCommented:
I'll look at the component.
0
 
ZifNabCommented:
Hi xpher,

this component only gives you the apportunity for making a shareware trial version. You still have to provide the code for after registration handling : e.g.

unit TestFrm;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Shareware, ExtCtrls;

type
  TTestForm = class(TForm)
    Panel1: TPanel;
    Label2: TLabel;
    Button1: TButton;
    Shareware1: TShareware;
    procedure Button1Click(Sender: TObject);
    procedure FormActivate(Sender: TObject);
  private
    { Déclarations privées }
  public
    { Déclarations publiques }
    function Registered : Boolean;
  end;

var
  TestForm: TTestForm;

implementation

{$R *.DFM}

function TTestForm.Registered: Boolean;
begin
 {Put here your actions, e.g. checking if program is registered}
end

procedure TTestForm.Button1Click(Sender: TObject);
begin
Close;
end;

procedure TTestForm.FormActivate(Sender: TObject);
begin
 If not(Registered) then Shareware1.Execute;
end;

end.

Where Registered first detects if program is registered are not.

Perhaps the other links will provide you a code which does registering and trial-test. But, if you use this component, you can use your own registering method.

Regards, Zif.
0
 
xpherAuthor Commented:
Thanks ZifNab, got the idea now.
Cheers
Chris :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.