Solved

Need to make app work just on one specific PC

Posted on 2011-02-11
14
923 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
delphi exception 7 64
Virtuailstring tree compare node issue 14 117
oracle global variables 4 68
firemonkey keyboard covers the controls 1 26
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

777 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