Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Need to make app work just on one specific PC

Posted on 2011-02-11
14
Medium Priority
?
929 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

636 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