Solved

Need to make app work just on one specific PC

Posted on 2011-02-11
14
921 Views
Last Modified: 2012-08-14
http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_26803051.html
This post is based on post above.

Now i need to write data into text file also and store it as a string that it would be as standard for all  kind of PC-s
I have idea do develop project in  more phases.  Step by step post by post.
1. read HW
2. encrypt
3. de-encrypt
4. compareHW
5. compare date
6. singing alelluia


procedure tform2.getHW();
       const
  Subkey: string = 'Hardware\description\system';
var
  hkSB: HKEY;
  rType: LongInt;
  ValueSize, OrigSize: Longint;
  ValueBuf: array[0..1000] of char;
str:string;


  procedure ParseValueBuf(const VersionType: string);
  var
    I, Line: Cardinal;
    S: string;
  begin
    i := 0;
    Line := 0;
    while ValueBuf[i] <> #0 do
    begin
      S := StrPas(@ValueBuf[i]);
      Inc(Line);
      Memo1.Lines.Append(Format('%s Line %d = %s',
        [VersionType, Line, S]));
      inc(i, Length(S) + 1);
    end
  end;


begin
  if RegOpenKeyEx(HKEY_LOCAL_MACHINE, PChar(Subkey), 0,
                  KEY_READ, hkSB) = ERROR_SUCCESS then
  try
    OrigSize := sizeof(ValueBuf);
    ValueSize := OrigSize;
    rType := REG_MULTI_SZ;
    if RegQueryValueEx(hkSB, 'SystemBiosVersion', nil, @rType,
      @ValueBuf, @ValueSize) = ERROR_SUCCESS then
      ParseValueBuf('System BIOS Version');

    ValueSize := OrigSize;
    rType := REG_SZ;
    if RegQueryValueEx(hkSB, 'SystemBIOSDate', nil, @rType,
      @ValueBuf, @ValueSize) = ERROR_SUCCESS then
      Memo1.Lines.Append('System BIOS Date ' + ValueBuf);

    ValueSize := OrigSize;
    rType := REG_MULTI_SZ;
    if RegQueryValueEx(hkSB, 'VideoBiosVersion', nil, @rType,
      @ValueBuf, @ValueSize) = ERROR_SUCCESS then
      ParseValueBuf('Video BIOS Version');

    ValueSize := OrigSize;
    rType := REG_SZ;
    if RegQueryValueEx(hkSB, 'VideoBIOSDate', nil, @rType,
      @ValueBuf, @ValueSize) = ERROR_SUCCESS then
      Memo1.Lines.Append('Video BIOS Date ' + ValueBuf);
       // Str := DateToStr(Now)  ;
        //Memo1.Lines.Append(str);


  finally
    RegCloseKey(hkSB);
  end;
end;

 procedure  tform2.comparedateum();
 var
 str:string;
 inte:integer;

 begin
 {Str := DateToStr(Now) ;
  edit1.text:=str;}


 end;

Open in new window

0
Comment
Question by:pr2501
  • 8
  • 6
14 Comments
 

Author Comment

by:pr2501
ID: 34875854
At the end i will divide it to two app-s.
0
 
LVL 14

Accepted Solution

by:
systan earned 500 total points
ID: 34876824
0
 

Author Comment

by:pr2501
ID: 34877260
it looks fine. But am lost.
So should i try to use registerHW.
But at firs how to integrate component?
0
 
LVL 14

Expert Comment

by:systan
ID: 34877458
Please read the link completely and you'll understand it well.
0
 

Author Comment

by:pr2501
ID: 34877989
ok
0
 

Author Comment

by:pr2501
ID: 34881579
[Pascal Error] mxProtectorAbout.pas(88): E2029 Expression expected but ';' found

I have Turbo Delphi version from 2006.
Any way to  proceed?
With Tfrm_AboutBox.Create( Application ) Do
     Try
          Lbl_ComponentName.Caption := ComponentName;

          Lbl_Delphi.Caption := 'Compiled in ' +

{$IFDEF VER80} 'Delphi 1.0'{$ENDIF}
{$IFDEF VER90} 'Delphi 2.0'{$ENDIF}
{$IFDEF VER100} 'Delphi 3.0'{$ENDIF}
{$IFDEF VER120} 'Delphi 4.0'{$ENDIF}
{$IFDEF VER130} 'Delphi 5.0'{$ENDIF}
{$IFDEF VER140} 'Delphi 6.0'{$ENDIF}
{$IFDEF VER150} 'Delphi 7.0'{$ENDIF}
{$IFDEF VER93} 'C++Builder 1.0'{$ENDIF}
{$IFDEF VER110} 'C++Builder 3.0'{$ENDIF}
{$IFDEF VER125} 'C++Builder 4.0'{$ENDIF}  ;

          ShowModal;

     Finally
          Free;

Open in new window

0
 
LVL 14

Expert Comment

by:systan
ID: 34881676
if you can removed that about, then try it.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:pr2501
ID: 34882480
If i remove code below a get errors on attached picture.
Lbl_Delphi.Caption := 'Compiled in ' +

{$IFDEF VER80} 'Delphi 1.0'{$ENDIF}
{$IFDEF VER90} 'Delphi 2.0'{$ENDIF}
{$IFDEF VER100} 'Delphi 3.0'{$ENDIF}
{$IFDEF VER120} 'Delphi 4.0'{$ENDIF}
{$IFDEF VER130} 'Delphi 5.0'{$ENDIF}
{$IFDEF VER140} 'Delphi 6.0'{$ENDIF}
{$IFDEF VER150} 'Delphi 7.0'{$ENDIF}
{$IFDEF VER93} 'C++Builder 1.0'{$ENDIF}
{$IFDEF VER110} 'C++Builder 3.0'{$ENDIF}
{$IFDEF VER125} 'C++Builder 4.0'{$ENDIF}  ;

Open in new window

host.JPG
0
 
LVL 14

Expert Comment

by:systan
ID: 34891369
try this;
Lbl_Delphi.Caption := 'Compiled in ' +
{$IFDEF VER180} Turbo 'Delphi 2006' {$ENDIF} ;
0
 

Author Comment

by:pr2501
ID: 34894846
No pozitive result.
 Does exist some procedure to get "my"
{$IFDEF VER180} ????????????{$ENDIF} ;
?
0
 
LVL 14

Expert Comment

by:systan
ID: 34895818
How about don't get the version, just let it go.
Lbl_Delphi.Caption := 'Compiled in DONT KNOW VERSION';
0
 

Author Comment

by:pr2501
ID: 34896139
I do get other errors so i believe thatis beter to give up.
0
 
LVL 14

Expert Comment

by:systan
ID: 34897700
Oh, men, try to use Delphi from Embarcadero, not from Old CodeGear.
Next time, do not accept if you haven't got what you wanted too, there are experts here listening, I don't they are not commenting, but they will soon, as long as you don't.

try to search google;
Delphi.7.Second.Edition.v7.2 Lite
you will find that, it's only 42mb size, you can try if the component really work.

or
anyway your code does great, use it and find anything that is useful to your code then attach it.


thanks
0
 

Author Comment

by:pr2501
ID: 34920200

I have got:
Delphi.7.Second.Edition.v7.2 Lite
and i have compiled and installated  new component from Your link  in it.
Now am researching it. And i see that it has many option of protection and sure they are much better than i can built as beginner.
I believe that i will open son new topic about use of  it.

Thank you very much.


0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now