Hardware

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Hardware

"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
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Hardware

A.J. Venter-2
>
> 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
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Hardware

"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 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  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

problems with colors

Eduardo Jaime Quiros Batres
In reply to this post by A.J. Venter-2
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:
                 [hidden email]

--
Eduardo Jaime Quirós Batres ([hidden email])
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Hardware

adrian_m
In reply to this post by "Fabrício F. Kammer"
On 22/08/06, "Fabrício F. Kammer" <[hidden email]> wrote:
> 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
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Hardware

Adrian Veith
In reply to this post by "Fabrício F. Kammer"
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.

Fabrício F. Kammer schrieb:

> 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  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal