[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Need to make app work just on one specific PC

Posted on 2011-02-11
14
Medium Priority
?
931 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 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Independent Software Vendors: 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!

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

834 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