Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2006-08

Hardware

6 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Fabrício F. Kammer

Hi all,

How can I get hardware informations on windows/linux using FreePascal/Lazarus?

I need to get some informations of the hardware, like HD serial number, the amount of memory, the type of processor and another things.

I'm working in a software that I don't want that it runs in a different of the orginal installation then I'll save this informations in a crypted file and I'll read and check with the hardware in the moment of the software is open.

Thanks again

A.J. Venter
to Fabrício F. Kammer
Show quoted text 6 lines
I'm working in a software that I don't want that it runs in a different of the orginal installation then I'll save this informations in a crypted file and I'll read and check with the hardware in the moment of the software is open.

There is no platform independent way to do this, since the the two OS's have very different approaches. Under windows you need to get the information from the registry, under linux you can get it by reading the files in /proc and /sys.

At some point somebody with some time should write a component that can give most used hardware information via a single interface with platform specific code to retrieve it. It's on my TODO list :)

A.J.

"there's nothing as inspirational for a hacker as a cat obscuring a bug by sitting in front of the monitor" - Boudewijn Rempt A.J. Venter Chief Software Architect OpenLab International www.getopenlab.com www.silentcoder.co.za +27 82 726 5103
Fabrício F. Kammer
to A.J. Venter

Thanks A.J.

Do you know where can I get some example of how to do this?

Is it possible to have a conditional compile to do this?

Thanks again,

Fabrício

A.J. Venter wrote 15 lines
> I'm working in a software that I don't want that it runs in a different > of the orginal installation then I'll save this informations in a > crypted file and I'll read and check with the hardware in the moment of > the software is open. > There is no platform independent way to do this, since the the two OS's have very different approaches. Under windows you need to get the information from the registry, under linux you can get it by reading the files in /proc and /sys. At some point somebody with some time should write a component that can give most used hardware information via a single interface with platform specific code to retrieve it. It's on my TODO list :) A.J.
Eduardo Jaime Quiros Batres
to A.J. Venter: There is no platform independent way to do this, since the the two OS's have very…

Good afternoon,

I'm trying to set colors (background) for fp but when I go to Options/Environment/Colors nothing happens.
Did find a reference to this problem on internet but not the solution.

I could change fp.ini if I knew how to. Where can I find a tutorial for fp.ini?

I'm using Linux and the result of "fpc -i" is:

Free Pascal Compiler version 2.0.2

Compiler Date : 2005/11/26
Compiler CPU Target: i386

Supported targets:
GO32 V2 DOS extender
Linux for i386
OS/2
Win32 for i386
FreeBSD/ELF for i386
Solaris for i386 (under development)
Beos for i386 (under development)
NetBSD for i386 (under development)
Netware for i386(clib)
WDOSX DOS extender
OpenBSD for i386 (under development)
OS/2 via EMX
Watcom compatible DOS extenders
Netware for i386(libc)
Linux for x64_6432

Supported CPU instruction sets:
386
PENTIUM
PENTIUM2
PENTIUM3
PENTIUM4

Supported FPU instruction sets:
SOFT
X87
SSE
SSE2

This program comes under the GNU General Public Licence For more information read COPYING.FPC

Report bugs,suggestions etc to:

Eduardo Jaime Quirós Batres ()
Adrian Maier
to Fabrício F. Kammer: Thanks A.J. Do you know where can I get some example of how to do this? Is it possible to…
"Fabrício F. Kammer" wrote 5 lines
Thanks A.J. Do you know where can I get some example of how to do this? Is it possible to have a conditional compile to do this?

You can achieve conditiional compiling with {$ifdef } :

{$ifdef  Win32}
   { .....  windows specific stuff .... }
{$endif}
{$ifdef  linux}
   { .....  linux specific stuff .... }
{$endif}
Adrian Maier
Adrian Veith
to Fabrício F. Kammer: Thanks A.J. Do you know where can I get some example of how to do this? Is it possible to…

google for the Jedi JCL library, it contains many useful routines for delphi - object pascal. with some handwork, the routines should work with fpc as well.

Adrian.

Show quoted text 30 lines
Thanks A.J. Do you know where can I get some example of how to do this? Is it possible to have a conditional compile to do this? Thanks again, Fabrício A.J. Venter escreveu: >> I'm working in a software that I don't want that it runs in a different >> of the orginal installation then I'll save this informations in a >> crypted file and I'll read and check with the hardware in the moment of >> the software is open. >> > There is no platform independent way to do this, since the the two > OS's have very different approaches. Under windows you need to get > the information from the registry, under linux you can get it by > reading the files in /proc and /sys. > > At some point somebody with some time should write a component that > can give most used hardware information via a single interface with > platform specific code to retrieve it. It's on my TODO list :) > > A.J. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal