[Lazarus] Determining OS

ik idokan at gmail.com
Sun Jul 31 16:55:12 CEST 2011


On Sun, Jul 31, 2011 at 17:43, Graeme Geldenhuys <graemeg.lists at gmail.com>wrote:

> 2011/7/31 ik <idokan at gmail.com>:
> > Please note that system.d is Fedora implementation (v15) so for Linux you
> > need to detect also the Linux distro, and that's a bit more complicated.
>
> Any distro worth using should support the LSB standards. With that
> being said, you can use the 'lsb_release' command to find out exactly
> what distribution and version is being used.
>

I'm using Arch Linux and that is my output:

------------------------
$ lsb_release
LSB Version:    n/a

$
-------------------------

But I have the following file:
/etc/arch-release


I think that looking for /etc/*release is more reliable at the moment for
distros.

BTW The TRegistry class is cross platform. On Windows it uses Registry, and
on other OS, it uses INI files.


>
>
> --------------------------------------------------------------------------
> $ lsb_release --help
> Usage: lsb_release [options]
>
> Options:
>  -h, --help         show this help message and exit
>  -v, --version      show LSB modules this system supports
>  -i, --id           show distributor ID
>  -d, --description  show description of this distribution
>  -r, --release      show release number of this distribution
>  -c, --codename     show code name of this distribution
>  -a, --all          show all of the above information
>  -s, --short        show all of the above information in short format
>
> $ lsb_release -a
> No LSB modules are available.
> Distributor ID: Ubuntu
> Description:    Ubuntu 8.04.4 LTS
> Release:        8.04
> Codename:       hardy
>
> --------------------------------------------------------------------------
>
>
> --
> Regards,
>   - Graeme -
>


Ido


>
>
> _______________________________________________
> fpGUI - a cross-platform Free Pascal GUI toolkit
> http://fpgui.sourceforge.net
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110731/3492b2c9/attachment-0003.html>


More information about the Lazarus mailing list