Solved

Need to make app work just on one specific PC

Posted on 2011-02-11
14
922 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how do i create updater to My Activex application? 3 79
Delphi with SQL Natvie Client 15 86
Delphi cmd execution 6 56
LAN or WAN ? 11 82
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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

864 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

21 Experts available now in Live!

Get 1:1 Help Now